Files
VoidTeamspeak/include/echoion/protocol/Util.hpp
T
faumaray 38e86d4a07 New arch
Signed-off-by: faumaray <faumaray@gmail.com>
2026-07-11 15:06:22 +03:00

25 lines
583 B
C++

#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