Base64 encoding and decoding helpers.
| 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. |
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().
inline
template<typename T> inline std::string encode(const T & bytes, int lineLength)Encodes an STL byte container to a Base64 string.
T Container type with a size() method and contiguous operator[].bytes Input data container.
lineLength Characters per line in the output (0 disables wrapping).
Base64-encoded string.
inline
template<typename T> inline std::string decode(const T & bytes)Decodes a Base64-encoded STL container to a binary string.
T Container type with a size() method and contiguous operator[].bytes Input Base64 data container.Decoded binary string.
| Return | Name | Description |
|---|---|---|
constexpr int | BUFFER_SIZE | |
constexpr int | LINE_LENGTH |
constexpr int BUFFER_SIZE = 16384constexpr int LINE_LENGTH = 72