| 28 | } // namespace |
| 29 | |
| 30 | std::string HexStr(const std::span<const uint8_t> s) |
| 31 | { |
| 32 | std::string rv(s.size() * 2, '\0'); |
| 33 | static constexpr auto byte_to_hex = CreateByteToHexMap(); |
| 34 | static_assert(sizeof(byte_to_hex) == 512); |
| 35 | |
| 36 | char* it = rv.data(); |
| 37 | for (uint8_t v : s) { |
| 38 | std::memcpy(it, byte_to_hex[v].data(), 2); |
| 39 | it += 2; |
| 40 | } |
| 41 | |
| 42 | assert(it == rv.data() + rv.size()); |
| 43 | return rv; |
| 44 | } |
| 45 | |
| 46 | const signed char p_util_hexdigit[256] = |
| 47 | { -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, |
nothing calls this directly
no test coverage detected