|
PebbleOS v4.47.0-512-g5285d4236
|
Base64 encoding. More...
Functions | |
| size_t | pbl_base64_encode (char *out, size_t out_len, const void *data, size_t data_len) |
| Encode data as standard (RFC 4648) padded base64. | |
| int | pbl_base64_decode (uint8_t *out, size_t out_len, const char *data, size_t data_len) |
| Decode standard (RFC 4648) padded base64. | |
Base64 encoding.
| int pbl_base64_decode | ( | uint8_t * | out, |
| size_t | out_len, | ||
| const char * | data, | ||
| size_t | data_len | ||
| ) |
Decode standard (RFC 4648) padded base64.
out may be the same buffer as data, as decoding never gets ahead of its input.
| [out] | out | Output buffer. |
| out_len | Size of out in bytes. | |
| data | Text to decode. | |
| data_len | Length of data, a multiple of 4. |
| -EINVAL | data is not valid base64. |
| -ENOSPC | out is too small. |
| size_t pbl_base64_encode | ( | char * | out, |
| size_t | out_len, | ||
| const void * | data, | ||
| size_t | data_len | ||
| ) |
Encode data as standard (RFC 4648) padded base64.
Calling it with a too small out (e.g. out_len 0) returns the required length without writing anything.
| [out] | out | Output buffer. Written only if it can hold the whole encoding; NUL-terminated when there is room left for the terminator. |
| out_len | Size of out in bytes. | |
| data | Data to encode. | |
| data_len | Number of bytes to encode. |