Base64 Utilities. More...

Modules

Decode Stream
Base64 stream decoding.
Encode Stream
Base64 stream encoding.

Functions

gos_result_t gos_base64_encode (void *dst, uint32_t dlen, uint32_t *olen, const void *src, uint32_t slen)
Encode a buffer into base64 format. More...
gos_result_t gos_base64_decode (void *dst, uint32_t dlen, uint32_t *olen, const void *src, uint32_t slen)
Decode a base64-formatted buffer. More...

Detailed Description

Base64 Utilities.

Function Documentation

gos_base64_decode()

gos_result_t gos_base64_decode ( void * dst,
uint32_t dlen,
uint32_t * olen,
const void * src,
uint32_t slen
)

Decode a base64-formatted buffer.

Parameters
[out] dst destination buffer
[in] dlen size of the destination buffer
[out] olen number of bytes written
[in] src source buffer
[in] slen amount of data to be decoded
Note
Call this function with *dlen = 0 to obtain the required buffer size in *dlen
Returns
GOS_SUCCESS if successful, GOS_BUFFER_OVERFLOW if the destination buffer is not large enough, or GOS_BAD_ARG if the input data is not correct. *dlen is always updated to reflect the amount of data that has (or would have) been written.

gos_base64_encode()

gos_result_t gos_base64_encode ( void * dst,
uint32_t dlen,
uint32_t * olen,
const void * src,
uint32_t slen
)

Encode a buffer into base64 format.

Parameters
[out] dst destination buffer
[in] dlen size of the buffer
[out] olen number of bytes written
[in] src source buffer
[in] slen amount of data to be encoded
Note
Call this function with *dlen = 0 to obtain the required buffer size in *dlen
Returns
GOS_SUCCESS if successful, or GOS_BUFFER_OVERFLOW if the destination buffer is not large enough. *dlen is always updated to reflect the amount of data that has (or would have) been written.