Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
utils.cpp
Go to the documentation of this file.
1
#include "
./utils.hpp
"
2
3
namespace
bb::utils
{
4
5
std::vector<uint8_t>
hex_to_bytes
(
const
std::string& hex)
6
{
7
std::vector<uint8_t> bytes;
8
9
for
(
unsigned
int
i = 0; i < hex.length(); i += 2) {
10
std::string byteString = hex.substr(i, 2);
11
bytes.push_back(
static_cast<
uint8_t
>
(strtol(byteString.c_str(),
nullptr
, 16)));
12
}
13
14
return
bytes;
15
}
16
17
}
// namespace bb::utils
bb::utils
Definition
utils.cpp:3
bb::utils::hex_to_bytes
std::vector< uint8_t > hex_to_bytes(const std::string &hex)
Routine to transform hexstring to vector of bytes.
Definition
utils.cpp:5
utils.hpp
src
barretenberg
common
utils.cpp
Generated by
1.9.8