Skip to content

LibHTTP API Reference – httplib_base64_encode()

httplib_base64_encode( src, src_len, dst, dst_len );


Parameter Type Description
src const unsigned char * Pointer to binary data to be BASE64 encoded
src_len int The number of bytes of the binary data to encode
dst char * Destination buffer for the encoding string
dst_len int Length of the destination buffer

Return Value

Type Description
int The size of the destination string or an error


The function httplib_base64_encode() encodes a block of binary data to a BASE64 encoded NUL terminated string. The destination buffer should be large enough to contain the whole string and NUL terminating character. If the function succeeds the actual number of used bytes in the destination buffer is returned. An error is indicated with the return value -1.

See Also