Signed-off-by: faumaray <faumaray@gmail.com>
This commit is contained in:
faumaray committed 2026-07-11 15:06:22 +03:00
commit 38e86d4a07
23 files changed
+3219

No files matched your search

+24
View File
@@ -0,0 +1,24 @@
#pragma once
// Small dependency-free encoding helpers shared across the protocol modules.
#include <cstdint>
#include <span>
#include <string>
#include <vector>
namespace Echoion::Protocol::Util
{
using Bytes = std::vector<uint8_t>;
using ByteView = std::span<const uint8_t>;
// Standard base64 (RFC 4648) with '+' '/' and '=' padding.
std::string base64Encode(ByteView data);
Bytes base64Decode(const std::string& text);
// Lowercase hex, no separators.
std::string toHex(ByteView data);
Bytes fromHex(const std::string& hex);
} // namespace Echoion::Protocol::Util