diff options
author | Wladimir J. van der Laan <laanwj@protonmail.com> | 2020-06-24 17:26:47 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@protonmail.com> | 2020-08-06 19:41:43 +0200 |
commit | 0a8aa626dd69a357e1b798b07b64cf4177a464a3 (patch) | |
tree | 44736ce734e8b6b2259becff3962ee3290f7969d /src/uint256.cpp | |
parent | 34eb2362581d4d8f0bfd3baa12ba750afaf85c62 (diff) |
refactor: Make HexStr take a span
Make HexStr take a span of bytes, instead of an awkward pair of
templated iterators.
Diffstat (limited to 'src/uint256.cpp')
-rw-r--r-- | src/uint256.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/uint256.cpp b/src/uint256.cpp index a5dfba41e2..ee1b34eadd 100644 --- a/src/uint256.cpp +++ b/src/uint256.cpp @@ -19,7 +19,11 @@ base_blob<BITS>::base_blob(const std::vector<unsigned char>& vch) template <unsigned int BITS> std::string base_blob<BITS>::GetHex() const { - return HexStr(std::reverse_iterator<const uint8_t*>(m_data + sizeof(m_data)), std::reverse_iterator<const uint8_t*>(m_data)); + uint8_t m_data_rev[WIDTH]; + for (int i = 0; i < WIDTH; ++i) { + m_data_rev[i] = m_data[WIDTH - 1 - i]; + } + return HexStr(m_data_rev); } template <unsigned int BITS> |