MCPcopy Create free account
hub / github.com/apache/thrift / hexChar

Function hexChar

lib/cpp/src/thrift/protocol/TJSONProtocol.cpp:261–268  ·  view source on GitHub ↗

Return the hex character representing the integer val. The value is masked to make sure it is in the correct range.

Source from the content-addressed store, hash-verified

259// Return the hex character representing the integer val. The value is masked
260// to make sure it is in the correct range.
261static uint8_t hexChar(uint8_t val) {
262 val &= 0x0F;
263 if (val < 10) {
264 return val + '0';
265 } else {
266 return val - 10 + 'a';
267 }
268}
269
270// Return true if the character ch is in [-+0-9.Ee]; false otherwise
271static bool isJSONNumeric(uint8_t ch) {

Callers 1

writeJSONEscapeCharMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected