Changeset View
Changeset View
Standalone View
Standalone View
src/test/uint256_tests.cpp
Show First 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | |||||
const uint160 OneS = uint160(std::vector<uint8_t>(OneArray, OneArray + 20)); | const uint160 OneS = uint160(std::vector<uint8_t>(OneArray, OneArray + 20)); | ||||
const uint8_t MaxArray[] = | const uint8_t MaxArray[] = | ||||
"\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" | "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" | ||||
"\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"; | "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"; | ||||
const uint256 MaxL = uint256(std::vector<uint8_t>(MaxArray, MaxArray + 32)); | const uint256 MaxL = uint256(std::vector<uint8_t>(MaxArray, MaxArray + 32)); | ||||
const uint160 MaxS = uint160(std::vector<uint8_t>(MaxArray, MaxArray + 20)); | const uint160 MaxS = uint160(std::vector<uint8_t>(MaxArray, MaxArray + 20)); | ||||
std::string ArrayToString(const uint8_t A[], unsigned int width) { | static std::string ArrayToString(const uint8_t A[], unsigned int width) { | ||||
std::stringstream Stream; | std::stringstream Stream; | ||||
Stream << std::hex; | Stream << std::hex; | ||||
for (unsigned int i = 0; i < width; ++i) { | for (unsigned int i = 0; i < width; ++i) { | ||||
Stream << std::setw(2) << std::setfill('0') | Stream << std::setw(2) << std::setfill('0') | ||||
<< (unsigned int)A[width - i - 1]; | << (unsigned int)A[width - i - 1]; | ||||
} | } | ||||
return Stream.str(); | return Stream.str(); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 219 Lines • Show Last 20 Lines |