ClikaRT::encoding
namespace
Functions
base64_encode(Span< uint8_t>)
std::string base64_encode(Span<const std::uint8_t> bytes)
Encode raw bytes to standard padded base64. Total; an empty input yields an empty string. bytes is read during the call, not retained.
Declared in ClikaRT/encoding/base64.h, line 29
base64_encode(string_view)
std::string base64_encode(std::string_view text)
Convenience overload: encode the bytes of a string view.
Declared in ClikaRT/encoding/base64.h, line 32
base64_decode(string_view)
std::vector<std::uint8_t> base64_decode(std::string_view text)
Declared in ClikaRT/encoding/base64.h, line 38
base64_encode(Tensor)
Declared in ClikaRT/encoding/base64.h, line 48
base64_decode(Tensor)
Declared in ClikaRT/encoding/base64.h, line 57
base64_encode(Span< string>)
std::vector<Tensor> base64_encode(ClikaRT::Span<const std::string> texts)
Declared in ClikaRT/encoding/base64.h, line 65
base64_decode(Span< string>)
std::vector<Tensor> base64_decode(ClikaRT::Span<const std::string> texts)
Declared in ClikaRT/encoding/base64.h, line 73
ClikaRT/encoding/base64.h
#include <ClikaRT/encoding/base64.h>
Standard base64 (RFC 4648 §4 alphabet A-Za-z0-9+/, = padding) over host bytes, the codec behind data: URIs, HTTP basic auth, and JSON binary payloads. Vectorized and, for large buffers, multi-threaded under the hood; small inputs stay single-threaded.
Encode is total. Decode is strict: it accepts the canonical padded form (length a multiple of 4 with 0–2 trailing =) and the unpadded form (trailing partial group of 2 or 3 characters), and raises ClikaRT::Error on any out-of-alphabet byte, a misplaced =, or an impossible length (length % 4 == 1).