|
Compy 0.2.0
A lightweight RTSP 1.0 server library for embedded systems
|
Base64 encoding and decoding (RFC 4648). More...
#include <stddef.h>#include <unistd.h>#include <compy/priv/compiler_attrs.h>
Go to the source code of this file.
Functions | |
| ssize_t | compy_base64_encode (const void *data, size_t len, char *out, size_t out_max) COMPY_PRIV_MUST_USE |
| Encodes binary data to base64. | |
| ssize_t | compy_base64_decode (const char *b64, size_t len, void *out, size_t out_max) COMPY_PRIV_MUST_USE |
| Decodes a base64 string to binary. | |
Base64 encoding and decoding (RFC 4648).
Self-contained implementation with no external dependencies. This is a private header; do not include directly from application code.
| ssize_t compy_base64_decode | ( | const char * | b64, |
| size_t | len, | ||
| void * | out, | ||
| size_t | out_max | ||
| ) |
Decodes a base64 string to binary.
| [in] | b64 | The base64-encoded string. |
| [in] | len | Length of b64 (excluding any null terminator). |
| [out] | out | Output buffer for decoded binary data. |
| [in] | out_max | Size of out. Must be at least (len / 4) * 3 bytes. |
out != NULLout_max is too small. | ssize_t compy_base64_encode | ( | const void * | data, |
| size_t | len, | ||
| char * | out, | ||
| size_t | out_max | ||
| ) |
Encodes binary data to base64.
| [in] | data | Input binary data. |
| [in] | len | Length of data. |
| [out] | out | Output buffer for the base64 string (null-terminated). |
| [in] | out_max | Size of out. Must be at least ((len + 2) / 3) * 4 + 1 bytes. |
out != NULLout_max is too small.