MCPcopy Create free account
hub / github.com/catboost/catboost / HexDecode

Function HexDecode

util/stream/hex.cpp:18–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16}
17
18void HexDecode(const void* in, size_t len, IOutputStream& out) {
19 Y_ENSURE(!(len & 1), TStringBuf("Odd buffer length passed to HexDecode"));
20
21 static const size_t NUM_OF_BYTES = 32;
22 char buffer[NUM_OF_BYTES];
23
24 auto current = static_cast<const char*>(in);
25 for (size_t take = 0; len; current += take, len -= take) {
26 take = Min(NUM_OF_BYTES * 2, len);
27 HexDecode(current, take, buffer);
28 out.Write(buffer, take / 2);
29 }
30}

Callers 1

TestImplFunction · 0.70

Calls 2

MinFunction · 0.50
WriteMethod · 0.45

Tested by 1

TestImplFunction · 0.56