I'm writing a fastest-code challenge over at PPCG relating to base conversion of bases 1 to 36, and as a part of the process for writing the competition, I decided to write my own program for it. This is the code I wish to be reviewed:public class BaseConv {    // Disallow instantiation    private BaseConv() {    }    // Base setup    private static final String BASEINFO = 0123456789abcdefghijklmnopqrstuvwxyz;    /**     * Converts a string as though it was an integer in base fromBase to base     * toBase.     *      * @param toConvert     *            The string to convert bases from.     * @param startbase     *            The base to convert from. Must be less than 37 and greater     *            than 1.     * @param endbase     *            The base to convert to. Must be less than 37 and greater than     *            1.     * @return converted The converted integer as type String.     */    public static String convBase(String toConvert, int fromBase, int toBase) throws NumberFormatException {        if (toBase > 36 | fromBase > 36 | toBase < 2 | fromBase < 2) {            throw new NumberFormatException(Bases specified must be less than 36 and greater than 2.);        }        String converted = , thisBase = BASEINFO.substring(0, fromBase);        char[] argument = toConvert.toCharArray(), baseinfochar = BASEINFO.toCharArray();        int sum = 0, i = argument.length, multi = 1, baseind;        for (; i > 0; multi *= fromBase) {            baseind = thisBase.indexOf(argument[--i]);                    if (baseind == -1)                        throw new NumberFormatException(Character  + argument[i] +  is not a valid number in base  + toBase);                    else                         sum += multi * baseind;        }        multi = (int) (Math.log(sum) / Math.log(toBase));        for (i = multi, multi = 1; i > 0; i--)            multi *= toBase;        for (; multi >= 1; sum %= multi, multi /= toBase) {            converted += baseinfochar[sum / multi];        }        return converted;    }}I wish to make sure that this code, with its current algorithm, is in the fastest setup possible, as well as being proper code (I plan on using this for more formal stuff later).The current algorithm goes something like this:The code checks to make sure that it's not attempting to exceed the bounds for possible base conversions.The code creates its own String and char[] variables from the first Base String, limiting the string to what the input fromBase base is (needn't change the char array size, since we use that specifically for output and it will never go over the specified output base).The code generates a sum of the numbers by multiplying according to their respective powers of the base.Calculates the log base toBase of the sum in order to find the largest power that it will be finding (to get rid of fluff).It then divides the sum by the respective power of the sought base, finding the indexes of the 'BASEINFO' (as a char array for the slightest speed increase) that align with them, and enacting a modulo on the sum to reduce its size.Note:  The PPCG challenge explicitly forbids the use of built-in base conversion methods.
Base converting with strings from bases 1 to 36 to bases 1 to 36
java;performance;parsing