public static int toDigit(char ch,int idx) throws IgniteCheckedException {
  int digit=Character.digit(ch,16);
  if (digit == -1)   throw new IgniteCheckedException("Illegal hexadecimal character " + ch + " at index "+ idx);
  return digit;
}

public static int toDigit ( char ch , int idx ) throws IgniteCheckedException { int digit = Character . digit ( ch , 16 ) ; if ( digit == - 1 ) throw new IgniteCheckedException ( "Illegal hexadecimal character " + ch + " at index " + idx ) ; return digit ; }
converts a hexadecimal character to an integer .
