| 175 | } |
| 176 | |
| 177 | inline |
| 178 | int |
| 179 | hex_digit(unsigned char c) noexcept |
| 180 | { |
| 181 | // by Peter Dimov |
| 182 | if( c >= '0' && c <= '9' ) |
| 183 | return c - '0'; |
| 184 | c &= ~0x20; |
| 185 | if( c >= 'A' && c <= 'F' ) |
| 186 | return 10 + c - 'A'; |
| 187 | return -1; |
| 188 | } |
| 189 | |
| 190 | } // detail |
| 191 |