| 22 | namespace dali { |
| 23 | |
| 24 | std::string to_hex_string(const std::string_view data) { |
| 25 | std::string hex; |
| 26 | hex.reserve(2 + data.size() * 2); |
| 27 | hex += "0x"; |
| 28 | const auto lut = "0123456789abcdef"; |
| 29 | for (unsigned char c : data) { |
| 30 | hex += lut[c >> 4]; |
| 31 | hex += lut[c & 0x0F]; |
| 32 | } |
| 33 | return hex; |
| 34 | } |
| 35 | |
| 36 | numpy::HeaderData ParseHeader(const std::string_view data) { |
| 37 | const auto numpy_magic = "\x93NUMPY"; |
no test coverage detected