C Collections

chttp · Section 3

chttp_base64_decode

chttp_base64_decode - decode a base64 string (default allocator)

C Collections (libccollections, -lccollections)

#include <ccollections/chttp.h>
 
void *chttp_base64_decode(const char *b64_input, size_t *out_len);

This is a static inline wrapper that calls chttp_base64_decode_mp()
with NULL memory management procedures, so it allocates with malloc.

b64_input  The NUL-terminated base64 string to decode. It must not
           be NULL.
out_len    Optional. It receives the number of decoded bytes. Pass
           NULL if you don't need it.

A new buffer with the decoded bytes on success.
NULL if the allocation fails or the input is malformed.

chttp_base64_decode_mp(3), chttp_base64_encode(3)