def siteswap_char_to_int(char):
    """ Converts a siteswap character to a digit """
    if not isinstance(char, str):
        raise ValueError("Invalid SiteSwap character: '{}'".format(char))
    if len(char) != 1:
        raise ValueError('Invalid SiteSwap character, too many characters')
    try:
        return int(char.lower(), 36)
    except ValueError:
        raise ValueError("Invalid SiteSwap character: '{}'".format(char))
