MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / CreateByteToHexMap

Function CreateByteToHexMap

src/crypto/hex_base.cpp:16–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14using ByteAsHex = std::array<char, 2>;
15
16constexpr std::array<ByteAsHex, 256> CreateByteToHexMap()
17{
18 constexpr char hexmap[16] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
19
20 std::array<ByteAsHex, 256> byte_to_hex{};
21 for (size_t i = 0; i < byte_to_hex.size(); ++i) {
22 byte_to_hex[i][0] = hexmap[i >> 4];
23 byte_to_hex[i][1] = hexmap[i & 15];
24 }
25 return byte_to_hex;
26}
27
28} // namespace
29

Callers 1

HexStrFunction · 0.85

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected