Converts input to a long number (arbitrary precision python long)
    :param x:
    :return:

def to_long(x):
    """
    Converts input to a long number (arbitrary precision python long)
    :param x:
    :return:
    """
    if isinstance(x, long):
        return x
    elif isinstance(x, int):
        return long(x)
    else:
        return bytes_to_long(to_bytes(x))