summaryrefslogtreecommitdiffstats
path: root/base64.c
diff options
context:
space:
mode:
Diffstat (limited to 'base64.c')
-rw-r--r--base64.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/base64.c b/base64.c
index 26ca7d7..95ccffc 100644
--- a/base64.c
+++ b/base64.c
@@ -41,7 +41,11 @@
static char base64_chars[] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
-
+/*
+ * base64 encode input data of length size to malloced
+ * buffer which is returned as *str. Returns string
+ * length of *str.
+ */
int
base64_encode(const void *data, int size, char **str)
{
@@ -115,7 +119,11 @@ token_decode(const char *token)
return DECODE_ERROR;
return (marker << 24) | val;
}
-
+/*
+ * Decode base64 str, outputting data to buffer
+ * at data of length size. Return length of
+ * decoded data written or -1 on error or overflow.
+ */
int
base64_decode(const char *str, void *data, int size)
{