Base module

base64

Base64 encoding and decoding helpers.

Classes

NameDescription
DecoderBase64 decoder.
EncoderBase64 encoder.

Functions

ReturnNameDescription
size_tencodedBufferCapacity inlineReturns 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::stringencode inlineEncodes an STL byte container to a Base64 string.
std::stringdecode inlineDecodes a Base64-encoded STL container to a binary string.

encodedBufferCapacity

inline

inline size_t encodedBufferCapacity(size_t inputSize, int lineLength = LINE_LENGTH)

Defined in src/base/include/icy/base64.h:89

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 = LINE_LENGTH)

Defined in src/base/include/icy/base64.h:189

Encodes an STL byte container to a Base64 string.

Returns

Base64-encoded string.

Parameters

ParameterTypeDescription
bytesconst T &Input data container.
lineLengthintCharacters per line in the output (0 disables wrapping).

decode

inline

template<typename T> inline std::string decode(const T & bytes)

Defined in src/base/include/icy/base64.h:314

Decodes a Base64-encoded STL container to a binary string.

Returns

Decoded binary string.

Parameters

ParameterTypeDescription
bytesconst T &Input Base64 data container.

Variables

ReturnNameDescription
constexpr intBUFFER_SIZE constexpr
constexpr intLINE_LENGTH constexpr

BUFFER_SIZE

constexpr

constexpr int BUFFER_SIZE = 16384

Defined in src/base/include/icy/base64.h:31


LINE_LENGTH

constexpr

constexpr int LINE_LENGTH = 72

Defined in src/base/include/icy/base64.h:32