X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=ucw%2Fbase64.h;h=31c1cb89b42ae9e3eacfd74011b7a32a2f83e76b;hb=dbe3b315edac25079fcbfe4df20e80b534f2a7a1;hp=78909664286f7e33c58039784024c5ad81ae43a9;hpb=031256ad2e123eec58521f8e3eb9496c197641d2;p=libucw.git diff --git a/ucw/base64.h b/ucw/base64.h index 78909664..31c1cb89 100644 --- a/ucw/base64.h +++ b/ucw/base64.h @@ -7,11 +7,21 @@ * of the GNU Lesser General Public License. */ +/** + * Encodes @len bytes of data pointed to by @src by base64 encoding. + * Stores them in @dest and returns the number of bytes the output + * takes. + */ uns base64_encode(byte *dest, const byte *src, uns len); +/** + * Decodes @len bytes of data pointed to by @src from base64 encoding. + * All invalid characters are ignored. The result is stored into @dest + * and length of the result is returned. + */ uns base64_decode(byte *dest, const byte *src, uns len); -/* - * Use this macro to calculate buffer size. +/** + * Use this macro to calculate @base64_encode() output buffer size. */ #define BASE64_ENC_LENGTH(x) (((x)+2)/3 *4) @@ -20,6 +30,6 @@ uns base64_decode(byte *dest, const byte *src, uns len); * always BASE64_OUT_CHUNK bytes long. If a longer block is split * to such chunks, the result will be identical. */ -#define BASE64_IN_CHUNK 3 -#define BASE64_OUT_CHUNK 4 +#define BASE64_IN_CHUNK 3 /** Size of chunk on the un-encoded side. **/ +#define BASE64_OUT_CHUNK 4 /** Size of chunk on the encoded side. **/