aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_strings_lib.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/gnunet_strings_lib.h')
-rw-r--r--src/include/gnunet_strings_lib.h30
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 */
361size_t 361size_t
362GNUNET_STRINGS_base64url_encode (const void *in, size_t len, char **output); 362GNUNET_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 */
373size_t
374GNUNET_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,
389size_t 401size_t
390GNUNET_STRINGS_base64url_decode (const char *data, size_t len, void **out); 402GNUNET_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 */
413size_t
414GNUNET_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.