Java conversion of base 16 to base 64
You are working too hard. Java has a Base64 class that does most of the work for you, all you need to do is combine it and the constructor for BigInteger, and you are done.

public static String base16to64(String hex){
    return Base64.getEncoder().encodeToString(new BigInteger(hex, 16).toByteArray());
}


For the linked example input:


  49276d206b696c6c696e6720796f757220627261696e206c696b65206120706f69736f6e6f7573206d757368726f6f6d


We get the correct output:


  SSdtIGtpbGxpbmcgeW91ciBicmFpbiBsaWtlIGEgcG9pc29ub3VzIG11c2hyb29t




If you wanted to implement the base 64 conversion yourself, note that you are still doing too much work. Your base16to10 function could be replaced with

BigInteger value = new BigInteger(hex, 16);


One function completely cut out.



However, if you don't want to use BigInteger at all (this is generally a bad idea, but for programming practice, you might want to), notice that log(64)/log(16) == 1.5. Thus, for every 1.5 hex digits, we can obtain 1 base 64 digits.

So take the last 2 hex digits of the hex string: 6d. In binary, this is 01101101. We only need to consider 101101, which is 45. So we take the 45th element of the base 64 alphabet: t. That's the last digit of the base 64 string. Now just shift the hex string over by 6 bits, and repeat (note, shifting by 6 bits won't be clean, so it's probably easier to instead process 3 hex digits to 2 base 64 digits, and take off the last two elements of the hex string).

But noticing the "Cryptopals Rule":


  Always operate on raw bytes, never on encoded strings. Only use hex and base64 for pretty-printing.


You should probably parse the hex string into a byte[] or ArrayList&lt;Byte&gt; before working on it. Honestly, I think this is way easier to do using BigInteger.