6#include <cryptopp/hex.h>
12 CryptoPP::StringSource hexSource{hex.data(),
true,
new CryptoPP::HexDecoder{
new CryptoPP::StringSink{hexBin}}};
14 std::vector<std::byte> out;
15 for (
char c : hexBin) {
16 out.push_back(
static_cast<std::byte
>(c));
22 std::ostringstream oss;
23 oss << std::hex << std::setfill(
'0');
24 for (
auto byte : hex) {
25 oss << std::setw(2) << static_cast<int>(std::to_integer<unsigned char>(
byte));
std::string encodeHexString(std::span< const std::byte > hex)
std::vector< std::byte > decodeHexString(std::string_view hex)