MCPcopy Create free account
hub / github.com/apache/brpc / HexDigitToInt

Function HexDigitToInt

src/butil/strings/string_util.h:384–393  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

382
383template <typename Char>
384inline Char HexDigitToInt(Char c) {
385 DCHECK(IsHexDigit(c));
386 if (c >= '0' && c <= '9')
387 return c - '0';
388 if (c >= 'A' && c <= 'F')
389 return c - 'A' + 10;
390 if (c >= 'a' && c <= 'f')
391 return c - 'a' + 10;
392 return 0;
393}
394
395// Returns true if it's a whitespace character.
396inline bool IsWhitespace(wchar_t c) {

Callers 1

TESTFunction · 0.85

Calls 1

IsHexDigitFunction · 0.85

Tested by 1

TESTFunction · 0.68