Implemented base32 encoding of chunks.

This commit is contained in:
Martin Willi
2010-05-05 10:41:11 +02:00
parent 9a0333fa62
commit b019c38fa2
2 changed files with 75 additions and 0 deletions
+12
View File
@@ -147,6 +147,18 @@ chunk_t chunk_to_base64(chunk_t chunk, char *buf);
*/
chunk_t chunk_from_base64(chunk_t base64, char *buf);
/**
* Convert a chunk of data to its base32 encoding.
*
* The resulting string is '\\0' terminated, but the chunk does not include
* the '\\0'. If buf is supplied, it must hold (chunk.len * 8 / 5 + 1) bytes.
*
* @param chunk data to convert
* @param buf buffer to write to, NULL to malloc
* @return chunk of encoded data
*/
chunk_t chunk_to_base32(chunk_t chunk, char *buf);
/**
* Free contents of a chunk
*/