Here you can find the source of toHexDigit(char ch, int index)
protected static int toHexDigit(char ch, int index) throws RuntimeException
//package com.java2s; /*//w w w. j a va 2 s. c o m * Copyright Gergely Nagy <greg@webhejj.hu> * * Licensed under the Apache License, Version 2.0; * you may obtain a copy of the License at: * * http://www.apache.org/licenses/LICENSE-2.0 */ public class Main { protected static int toHexDigit(char ch, int index) throws RuntimeException { int digit = Character.digit(ch, 16); if (digit == -1) { throw new RuntimeException("Illegal hexadecimal charcter " + ch + " at index " + index); } return digit; } }