def base62_decode(string):
alphabet = '<STR_LIT>'<EOL>base = len(alphabet)<EOL>strlen = len(string)<EOL>num = <NUM_LIT:0><EOL>idx = <NUM_LIT:0><EOL>for char in string:<EOL><INDENT>power = (strlen - (idx + <NUM_LIT:1>))<EOL>num += alphabet.index(char) * (base ** power)<EOL>idx += <NUM_LIT:1><EOL><DEDENT>return int(num)<EOL>
Decode a Base X encoded string into the number

    Arguments:
    - `string`: The encoded string
    - `alphabet`: The alphabet to use for encoding
    Stolen from: http://stackoverflow.com/a/1119769/1144479