public static int strxtoi(String hex)
	{
		final int ASCII_CUTOFF_INTS = 48;
		final int ASCII_CUTOFF_LETTERS = 65;
		final int ASCII_SUBTRACT_LETTERS = 55;
		final int BASE = 16;
		int sum = 0;
		for(int i = 0 ; i < hex.length() ; i++){
			sum *= BASE;
			int val = (int) hex.charAt(i);
			if(val >= ASCII_CUTOFF_LETTERS){ // if a letter
				sum += val - ASCII_SUBTRACT_LETTERS;
			} else{ // if a digit
				sum += val - ASCII_CUTOFF_INTS;//get the ascii value, then subtract the cutoff.
			}
		}
		return sum;
	}