(s, charset)
return output
Turn a string into a non-negative integer.
Turn a string into a non-negative integer.
Turn a string into a non - negative integer .
def charset_to_int(s, charset):
    """ Turn a string into a non-negative integer.
    """
    output = 0
    for char in s:
        output = output * len(charset) + charset.index(char)
    return output
def charset_to_int ( s , charset ) : output = 0 for char in s : output = output * len ( charset ) + charset . index ( char ) return output