Here you can find the source of getHexDigit(String s, int i)
private static int getHexDigit(String s, int i)
//package com.java2s; /*// w w w . ja v a 2 s .c om * Copyright 2004-2008 H2 Group. Multiple-Licensed under the H2 License, Version 1.0, and under the Eclipse Public License, Version 1.0 (http://h2database.com/html/license.html). Initial Developer: H2 Group */ public class Main { private static int getHexDigit(String s, int i) { char c = s.charAt(i); if (c >= '0' && c <= '9') { return c - '0'; } else if (c >= 'a' && c <= 'f') { return c - 'a' + 0xa; } else if (c >= 'A' && c <= 'F') { return c - 'A' + 0xa; } else { throw new RuntimeException("Can't get hex digit from " + s + " at " + i); } } }