22 const std::string random_hex_string(buffer.begin(), buffer.end());
23 const std::vector<unsigned char> data =
ParseHex(random_hex_string);
24 const std::vector<std::byte> bytes{ParseHex<std::byte>(random_hex_string)};
26 const std::string hex_data =
HexStr(data);
27 if (
IsHex(random_hex_string)) {
32 assert(random_hex_string.length() == 64);
bool DecodeHexBlk(CBlock &, const std::string &strHexBlk)
std::vector< Byte > ParseHex(std::string_view hex_str)
Like TryParseHex, but returns an empty vector on invalid input.
bool IsHexNumber(std::string_view str)
Return true if the string is a hex number, optionally prefixed with "0x".
bool IsHex(std::string_view str)
CPubKey HexToPubKey(const std::string &hex_in)
bool DecodeHexBlockHeader(CBlockHeader &, const std::string &hex_header)
static std::optional< uint256 > FromHex(std::string_view str)
std::string ToLower(std::string_view str)
Returns the lowercase equivalent of the given string.
std::string HexStr(const Span< const uint8_t > s)
Convert a span of bytes to a lower-case hexadecimal string.
Span< const std::byte > AsBytes(Span< T > s) noexcept
uint256 uint256S(std::string_view str)
A Span is an object that can refer to a contiguous sequence of objects.
static std::optional< transaction_identifier > FromHex(std::string_view hex)