decode LEN hex digits, return decoded number, -1 if invalid
| 870 | |
| 871 | // decode LEN hex digits, return decoded number, -1 if invalid |
| 872 | int decodeHex( const lChar16 * str, int len ) { |
| 873 | int n = 0; |
| 874 | for ( int i=0; i<len; i++ ) { |
| 875 | if ( !str[i] ) |
| 876 | return -1; |
| 877 | int d = hexDigit(str[i]); |
| 878 | if ( d==-1 ) |
| 879 | return -1; |
| 880 | n = (n<<4) | d; |
| 881 | } |
| 882 | return n; |
| 883 | } |
| 884 | |
| 885 | // decode LEN decimal digits, return decoded number, -1 if invalid |
| 886 | int decodeDecimal( const lChar16 * str, int len ) { |
no test coverage detected