private static int hexValue(char c) {
		if (c >= '0' && c <= '9') return (c - '0');
		if (c >= 'A' && c <= 'F') return 10 + (c - 'A');
		throw new IllegalArgumentException("Invalid hexadecimal character " + c);
	}