uint8_t decode_hex_nibble()

in src/codec/string.cpp [42:47]


uint8_t decode_hex_nibble(decode_context &context, const char c) {
  if (c >= '0' && c <= '9') { return c - '0'; }
  if (c >= 'a' && c <= 'f') { return c - 'a' + 0xA; }
  if (c >= 'A' && c <= 'F') { return c - 'A' + 0xA; }
  detail::fail(context, "\\u must be followed by 4 hex digits");
}