----------------------------------------------------------------------------- Purpose: Helper for converting a hex char value to numeric, return -1 if the char is not a valid hex digit. -----------------------------------------------------------------------------
| 230 | // is not a valid hex digit. |
| 231 | //----------------------------------------------------------------------------- |
| 232 | int iHexCharToInt( char cValue ) |
| 233 | { |
| 234 | int32_t iValue = cValue; |
| 235 | if ( (uint32_t)( iValue - '0' ) < 10 ) |
| 236 | return iValue - '0'; |
| 237 | |
| 238 | iValue |= 0x20; |
| 239 | if ( (uint32_t)( iValue - 'a' ) < 6 ) |
| 240 | return iValue - 'a' + 10; |
| 241 | |
| 242 | return -1; |
| 243 | } |
| 244 | |
| 245 | //----------------------------------------------------------------------------- |
| 246 | // Purpose: Internal implementation of encode, works in the strict RFC manner, or |
no outgoing calls
no test coverage detected