pw_base64#

This module provides functions for encoding, decoding, and validating Base64 data as specified by RFC 3548 and RFC 4648.

Note

The documentation for this module is currently incomplete.

constexpr size_t pw::base64::EncodedSize(size_t binary_size_bytes)#
Returns:

The size of the given number of bytes when encoded as Base64. Base64 encodes 3-byte groups into 4-character strings. The final group is padded to be 3 bytes if it only has 1 or 2.

constexpr size_t pw::base64::MaxDecodedSize(size_t base64_size_bytes)#

Calculates the maximum size of Base64-encoded data after decoding.

pre:

base64_size_bytes must be a multiple of 4, since Base64 encodes 3-byte groups into 4-character strings.

Parameters:

base64_size_bytes[in] The size of the Base64-encoded data.

Returns:

The maximum size of the Base64-encoded data represented by base64_bytes_size after decoding. If the last 3-byte group has padding, the actual decoded size will be 1 or 2 bytes less than the value returned by MaxDecodedSize().