Data Structures | |
struct | endif |
Functions | |
size_t | b64_encode (void const *src, size_t srcSize, char *dest, size_t destLen) |
Encodes a block of binary data into Base-64. | |
size_t | b64_encode2 (void const *src, size_t srcSize, char *dest, size_t destLen, unsigned flags, int lineLen, B64_RC *rc) |
size_t | b64_decode (char const *src, size_t srcLen, void *dest, size_t destSize) |
Decodes a sequence of Base-64 into a block of binary data. | |
size_t | b64_decode2 (char const *src, size_t srcLen, void *dest, size_t destSize, unsigned flags, char const **badChar, B64_RC *rc) |
char const * | b64_getErrorString (B64_RC code) |
size_t | b64_getErrorStringLength (B64_RC code) |
Variables | |
struct b64ErrorString_t_ else typedef struct b64ErrorString_t_ | b64ErrorString_t_ |
Implementation file for the b64 library
size_t b64_decode | ( | char const * | src, | |
size_t | srcLen, | |||
void * | dest, | |||
size_t | destSize | |||
) |
Decodes a sequence of Base-64 into a block of binary data.
src | Pointer to the Base-64 block to be decoded. May not be NULL, except when dest is NULL, in which case it is ignored. If dest is NULL, and src is not NULL, then the returned value is calculated exactly, otherwise a value is returned that is guaranteed to be large enough to hold the decoded block. | |
srcLen | Length of block to be encoded. Must be an integral of 4, the Base-64 encoding quantum, otherwise the Base-64 block is assumed to be invalid | |
dest | Pointer to the buffer into which the result is to be written. May be NULL, in which case the function returns the required length | |
destSize | Length of the buffer into which the result is to be written. Must be at least as large as that indicated by the return value from b64_decode(src, srcSize, NULL, 0) , even in the case where the encoded form contains a number of characters that will be ignored, resulting in a lower total length of converted form. |
destSize
dest
is NULL. The returned size might be larger than the actual required size, but will never be smaller.References B64_NAMESPACE::B64_F_STOP_ON_NOTHING.
size_t b64_encode | ( | void const * | src, | |
size_t | srcSize, | |||
char * | dest, | |||
size_t | destLen | |||
) |
Encodes a block of binary data into Base-64.
src | Pointer to the block to be encoded. May not be NULL, except when dest is NULL, in which case it is ignored. | |
srcSize | Length of block to be encoded | |
dest | Pointer to the buffer into which the result is to be written. May be NULL, in which case the function returns the required length | |
destLen | Length of the buffer into which the result is to be written. Must be at least as large as that indicated by the return value from b64_encode(NULL, srcSize, NULL, 0). |
destLen
dest
is NULLdest
is NULL. The returned size might be larger than the actual required size, but will never be smaller.