-extern void hex2bin(char *src, char *dst, int length);
-extern void bin2hex(char *src, char *dst, int length);
+extern size_t b64encode(const void *src, char *dst, size_t length);
+extern size_t b64encode_urlsafe(const void *src, char *dst, size_t length);
+extern size_t b64decode(const char *src, void *dst, size_t length);