diff options
Diffstat (limited to 'src/include/gnunet_strings_lib.h')
-rw-r--r-- | src/include/gnunet_strings_lib.h | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/src/include/gnunet_strings_lib.h b/src/include/gnunet_strings_lib.h index 663b44194..bd3ac9dbf 100644 --- a/src/include/gnunet_strings_lib.h +++ b/src/include/gnunet_strings_lib.h | |||
@@ -350,16 +350,28 @@ GNUNET_STRINGS_base64_encode (const void *in, | |||
350 | 350 | ||
351 | 351 | ||
352 | /** | 352 | /** |
353 | * Encode into Base64url. RFC7515 | 353 | * url/percent encode (RFC3986). |
354 | * | 354 | * |
355 | * @param in the data to encode | 355 | * @param data the data to decode |
356 | * @param len the length of the input | 356 | * @param len the length of the input |
357 | * @param output where to write the output (*output should be NULL, | 357 | * @param output where to write the output (*output should be NULL, |
358 | * is allocated) | 358 | * is allocated) |
359 | * @return the size of the output | 359 | * @return the size of the output |
360 | */ | 360 | */ |
361 | size_t | 361 | size_t |
362 | GNUNET_STRINGS_base64url_encode (const void *in, size_t len, char **output); | 362 | GNUNET_STRINGS_urlencode (const char *data, size_t len, char **out); |
363 | |||
364 | /** | ||
365 | * Decode from Base64url. RFC7515 | ||
366 | * | ||
367 | * @param data the data to decode | ||
368 | * @param len the length of the input | ||
369 | * @param output where to write the output (*output should be NULL, | ||
370 | * is allocated) | ||
371 | * @return the size of the output | ||
372 | */ | ||
373 | size_t | ||
374 | GNUNET_STRINGS_base64url_decode (const char *data, size_t len, void **out); | ||
363 | 375 | ||
364 | 376 | ||
365 | /** | 377 | /** |
@@ -389,6 +401,18 @@ GNUNET_STRINGS_base64_decode (const char *data, | |||
389 | size_t | 401 | size_t |
390 | GNUNET_STRINGS_base64url_decode (const char *data, size_t len, void **out); | 402 | GNUNET_STRINGS_base64url_decode (const char *data, size_t len, void **out); |
391 | 403 | ||
404 | /** | ||
405 | * url/percent encode (RFC3986). | ||
406 | * | ||
407 | * @param data the data to encode | ||
408 | * @param len the length of the input | ||
409 | * @param output where to write the output (*output should be NULL, | ||
410 | * is allocated) | ||
411 | * @return the size of the output | ||
412 | */ | ||
413 | size_t | ||
414 | GNUNET_STRINGS_urldecode (const char *data, size_t len, char **out); | ||
415 | |||
392 | 416 | ||
393 | /** | 417 | /** |
394 | * Convert a peer path to a human-readable string. | 418 | * Convert a peer path to a human-readable string. |