14 template <
unsigned int BITS>
17 assert(vch.size() ==
sizeof(data));
18 memcpy(data, vch.data(),
sizeof(data));
21 template <
unsigned int BITS>
24 return HexStr(std::reverse_iterator<const uint8_t*>(data +
sizeof(data)), std::reverse_iterator<const uint8_t*>(data));
27 template <
unsigned int BITS>
30 memset(data, 0,
sizeof(data));
37 if (psz[0] ==
'0' && tolower(psz[1]) ==
'x')
41 const char* pbegin = psz;
45 unsigned char* p1 = (
unsigned char*)data;
46 unsigned char* pend = p1 + WIDTH;
47 while (psz >= pbegin && p1 < pend) {
50 *p1 |= ((
unsigned char)::
HexDigit(*psz--) << 4);
56 template <
unsigned int BITS>
62 template <
unsigned int BITS>
std::string HexStr(const T itbegin, const T itend, bool fSpaces=false)
std::string ToString() const
void * memcpy(void *a, const void *b, size_t c)
std::string GetHex() const
signed char HexDigit(char c)
void SetHex(const char *psz)