MCPcopy Create free account
hub / github.com/NVIDIA/DALI / to_hex_string

Function to_hex_string

dali/operators/decoder/numpy.cc:24–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22namespace dali {
23
24std::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
36numpy::HeaderData ParseHeader(const std::string_view data) {
37 const auto numpy_magic = "\x93NUMPY";

Callers 1

ParseHeaderFunction · 0.85

Calls 2

reserveMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected