Changeset View
Changeset View
Standalone View
Standalone View
src/uint256.cpp
Show All 19 Lines | template <unsigned int BITS> std::string base_blob<BITS>::GetHex() const { | ||||
return HexStr(std::reverse_iterator<const uint8_t *>(data + sizeof(data)), | return HexStr(std::reverse_iterator<const uint8_t *>(data + sizeof(data)), | ||||
std::reverse_iterator<const uint8_t *>(data)); | std::reverse_iterator<const uint8_t *>(data)); | ||||
} | } | ||||
template <unsigned int BITS> void base_blob<BITS>::SetHex(const char *psz) { | template <unsigned int BITS> void base_blob<BITS>::SetHex(const char *psz) { | ||||
memset(data, 0, sizeof(data)); | memset(data, 0, sizeof(data)); | ||||
// skip leading spaces | // skip leading spaces | ||||
while (isspace(*psz)) { | while (IsSpace(*psz)) { | ||||
psz++; | psz++; | ||||
} | } | ||||
// skip 0x | // skip 0x | ||||
if (psz[0] == '0' && tolower(psz[1]) == 'x') { | if (psz[0] == '0' && tolower(psz[1]) == 'x') { | ||||
psz += 2; | psz += 2; | ||||
} | } | ||||
Show All 36 Lines |