mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 23:18:14 +01:00
refactor: Make HexStr take a span
Make HexStr take a span of bytes, instead of an awkward pair of templated iterators.
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user