We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6206252 commit 0a17714Copy full SHA for 0a17714
src/uint256.cpp
@@ -20,10 +20,7 @@ base_blob<BITS>::base_blob(const std::vector<unsigned char>& vch)
20
template <unsigned int BITS>
21
std::string base_blob<BITS>::GetHex() const
22
{
23
- char psz[sizeof(data) * 2 + 1];
24
- for (unsigned int i = 0; i < sizeof(data); i++)
25
- sprintf(psz + i * 2, "%02x", data[sizeof(data) - i - 1]);
26
- return std::string(psz, psz + sizeof(data) * 2);
+ return HexStr(std::reverse_iterator<const uint8_t*>(data + sizeof(data)), std::reverse_iterator<const uint8_t*>(data));
27
}
28
29
0 commit comments