| 15 | extern const char* const Char2DigitTable; |
| 16 | |
| 17 | inline static int Char2Digit(char ch) { |
| 18 | char result = Char2DigitTable[(unsigned char)ch]; |
| 19 | Y_ENSURE(result != '\xff', "invalid hex character " << (int)ch); |
| 20 | return result; |
| 21 | } |
| 22 | |
| 23 | //! Convert a hex string of exactly 2 chars to int |
| 24 | /*! @example String2Byte("10") => 16 */ |