def string_to_int(string, alphabet):
number = <NUM_LIT:0><EOL>alpha_len = len(alphabet)<EOL>for char in string:<EOL><INDENT>number = number * alpha_len + alphabet.index(char)<EOL><DEDENT>return number<EOL>
Convert a string to a number, using the given alphabet.
The input is assumed to have the most significant digit first.