13 template <
unsigned int BITS>
20 template <
unsigned int BITS>
23 return HexStr(std::reverse_iterator<const uint8_t*>(
data +
sizeof(
data)), std::reverse_iterator<const uint8_t*>(
data));
26 template <
unsigned int BITS>
29 char psz[
sizeof(
data) * 2 + 1];
31 for (
int i =
sizeof(
data)-1; i >= 0; i--) {
32 sprintf(psz + j * 2,
"%02x",
data[
sizeof(
data) - i - 1]);
35 return std::string(psz, psz +
sizeof(
data) * 2);
38 template <
unsigned int BITS>
48 if (psz[0] ==
'0' && tolower(psz[1]) ==
'x')
52 const char* pbegin = psz;
56 unsigned char* p1 = (
unsigned char*)
data;
57 unsigned char* pend = p1 + WIDTH;
58 while (psz >= pbegin && p1 < pend) {
61 *p1 |= ((
unsigned char)::
HexDigit(*psz--) << 4);
67 template <
unsigned int BITS>
73 template <
unsigned int BITS>
80 unsigned char* p1 = (
unsigned char*)
data;
83 p1[left++] = p1[right];
88 template <
unsigned int BITS>
91 SetReverseHex(str.c_str());
94 template <
unsigned int BITS>
std::string GetHex() const
std::string HexStr(const T itbegin, const T itend, bool fSpaces=false)
assert(len-trim+(2 *lenIndices)<=WIDTH)
std::string ToString() const
void SetReverseHex(const char *psz)
std::string GetReverseHex() const
uint8_t const size_t const size
void * memcpy(void *a, const void *b, size_t c)
signed char HexDigit(char c)
void SetHex(const char *psz)