10template <
unsigned int BITS>
13 uint8_t m_data_rev[WIDTH];
14 for (
int i = 0; i < WIDTH; ++i) {
15 m_data_rev[i] = m_data[WIDTH - 1 - i];
20template <
unsigned int BITS>
23 std::fill(m_data.begin(), m_data.end(), 0);
31 for (
const char c : trimmed) {
35 unsigned char* p1 = m_data.data();
36 unsigned char* pend = p1 + WIDTH;
37 while (digits > 0 && p1 < pend) {
40 *p1 |= ((
unsigned char)
::HexDigit(trimmed[--digits]) << 4);
46template <
unsigned int BITS>
std::string ToString() const
void SetHexDeprecated(std::string_view str)
Unlike FromHex this accepts any invalid input, thus it is fragile and deprecated!
std::string GetHex() const
static const uint256 ZERO
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_view TrimStringView(std::string_view str, std::string_view pattern=" \f\n\r\t\v")
std::string_view RemovePrefixView(std::string_view str, std::string_view prefix)