MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / markerHexEncode

Function markerHexEncode

programs/client/FuzzLoop.cpp:551–562  ·  view source on GitHub ↗

Encode a string as uppercase hex so it contains no whitespace or dots, making it safe to embed in the one-line external-command replay marker.

Source from the content-addressed store, hash-verified

549/// Encode a string as uppercase hex so it contains no whitespace or dots,
550/// making it safe to embed in the one-line external-command replay marker.
551static String markerHexEncode(const String & s)
552{
553 static const char hex_digits[] = "0123456789ABCDEF";
554 String result;
555 result.reserve(s.size() * 2);
556 for (const unsigned char c : s)
557 {
558 result += hex_digits[c >> 4];
559 result += hex_digits[c & 0xF];
560 }
561 return result;
562}
563
564/// Decode a hex string written by markerHexEncode.
565static String markerHexDecode(const String & s)

Callers 1

buzzHouseMethod · 0.85

Calls 2

reserveMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected