10template <
unsigned int BITS>
12 assert(vch.size() ==
sizeof(m_data));
13 memcpy(m_data, vch.data(),
sizeof(m_data));
17 uint8_t m_data_rev[WIDTH];
18 for (
int i = 0; i < WIDTH; ++i) {
19 m_data_rev[i] = m_data[WIDTH - 1 - i];
25 memset(m_data, 0,
sizeof(m_data));
33 if (psz[0] ==
'0' &&
ToLower(psz[1]) ==
'x') {
43 uint8_t *p1 = (uint8_t *)m_data;
44 uint8_t *pend = p1 + WIDTH;
45 while (digits > 0 && p1 < pend) {
48 *p1 |= uint8_t(
::HexDigit(psz[--digits])) << 4;
54template <
unsigned int BITS>
void SetHex(const char *psz)
std::string ToString() const
std::string GetHex() const
static const uint256 ZERO
constexpr bool IsSpace(char c) noexcept
Tests if the given character is a whitespace character.
std::string HexStr(const Span< const uint8_t > s)
Convert a span of bytes to a lower-case hexadecimal string.
signed char HexDigit(char c)
std::string ToLower(std::string_view str)
Returns the lowercase equivalent of the given string.