Base module
base64
Base64 encoding and decoding helpers.
base64
Base64 encoding and decoding helpers.
Classes
Functions
| Return | Name | Description |
|---|---|---|
size_t | encodedBufferCapacity inline | Returns a safe temporary buffer size for encoding up to inputSize bytes. Includes padding/newline slack so callers can reuse the same buffer for finalize(). |
std::string | encode inline | Encodes an STL byte container to a Base64 string. |
std::string | decode inline | Decodes a Base64-encoded STL container to a binary string. |
encodedBufferCapacity
inline
inline size_t encodedBufferCapacity(size_t inputSize, int lineLength)Returns a safe temporary buffer size for encoding up to inputSize bytes. Includes padding/newline slack so callers can reuse the same buffer for finalize().
encode
inline
template<typename T> inline std::string encode(const T & bytes, int lineLength)Encodes an STL byte container to a Base64 string.
Parameters
TContainer type with asize()method and contiguousoperator[].
Parameters
bytesInput data container.lineLengthCharacters per line in the output (0 disables wrapping).
Returns
Base64-encoded string.
decode
inline
template<typename T> inline std::string decode(const T & bytes)Decodes a Base64-encoded STL container to a binary string.
Parameters
TContainer type with asize()method and contiguousoperator[].
Parameters
bytesInput Base64 data container.
Returns
Decoded binary string.
Variables
| Return | Name | Description |
|---|---|---|
constexpr int | BUFFER_SIZE | |
constexpr int | LINE_LENGTH |
BUFFER_SIZE
constexpr int BUFFER_SIZE = 16384LINE_LENGTH
constexpr int LINE_LENGTH = 72