11.1. base64 — Base64 encoding and decoding.

Source code: src/encode/base64.h, src/encode/base64.c

Test code: tst/encode/base64/main.c

Test coverage: src/encode/base64.c


int base64_encode(char *dst_p, const void *src_p, size_t size)
int base64_decode(void *dst_p, const char *src_p, size_t size)

Decode given base64 encoded buffer. The decoded data will be ~25% smaller than the destination data. Choose the destination buffer size accordingly.

zero(0) or negative error code.
  • dst_p: Output data.
  • src_p: Encoded input data.
  • size: Number of bytes in the encoded input data.