|
JH-Toolkit v1.4.1
An engineering-oriented C++20 toolkit with duck-typed concepts, static design, async coroutines, and semantic containers — header-only, RTTI-free, and concurrency-friendly.
|
High-level Base64 and Base64URL serialization interface for the JH Toolkit. More...
#include <cstdint>#include <cstddef>#include <string>#include <vector>#include <stdexcept>#include "jh/pods/string_view.h"#include "jh/pods/bytes_view.h"#include "jh/macros/header_begin.h"#include "jh/macros/header_end.h"Go to the source code of this file.
Namespaces | |
| namespace | jh::serio |
| Aggregated entry point for serialization and codec utilities. | |
| namespace | jh::serio::base64 |
| Implements standard Base64 (RFC 4648 §4) encoding and decoding. | |
| namespace | jh::serio::base64url |
| Implements Base64URL (RFC 4648 §5) — the URL-safe variant of Base64. | |
Functions | |
| std::string | jh::serio::base64::encode (const std::uint8_t *data, std::size_t len) |
| Encode raw binary data into a Base64 string. | |
| std::vector< std::uint8_t > | jh::serio::base64::decode (const std::string &input) |
| Decode a Base64 string into a byte vector. | |
| jh::pod::bytes_view | jh::serio::base64::decode (const std::string &input, std::vector< std::uint8_t > &output_buffer) |
| Decode a Base64-encoded string into raw bytes. | |
| jh::pod::string_view | jh::serio::base64::decode (const std::string &input, std::string &output_buffer) |
| Decode a Base64-encoded string into textual data. | |
| std::string | jh::serio::base64url::encode (const std::uint8_t *data, std::size_t len, bool pad=false) |
| Encode raw binary data into a Base64URL string. | |
| std::vector< std::uint8_t > | jh::serio::base64url::decode (const std::string &input) |
| Decode a Base64URL string into a byte vector. | |
| jh::pod::bytes_view | jh::serio::base64url::decode (const std::string &input, std::vector< std::uint8_t > &output_buffer) |
| Decode a Base64URL-encoded string into raw bytes. | |
| jh::pod::string_view | jh::serio::base64url::decode (const std::string &input, std::string &output_buffer) |
| Decode a Base64URL-encoded string into textual data. | |
High-level Base64 and Base64URL serialization interface for the JH Toolkit.
This header provides a modern, type-safe, and constexpr-enabled Base64 / Base64URL codec implementation. It is part of the JH Toolkit Serialization I/O module (shortened as jh::serio), and serves as the first officially supported serialization format within the toolkit.
std::runtime_error on error. -O3). 1.4.1
2025