Changeset View
Changeset View
Standalone View
Standalone View
src/uint256.cpp
Show All 24 Lines | 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(uint8_t(psz[1])) == 'x') { | ||||
psz += 2; | psz += 2; | ||||
} | } | ||||
// hex string to uint | // hex string to uint | ||||
const char *pbegin = psz; | const char *pbegin = psz; | ||||
while (::HexDigit(*psz) != -1) { | while (::HexDigit(*psz) != -1) { | ||||
psz++; | psz++; | ||||
} | } | ||||
Show All 31 Lines |