Converts input to a byte string.
    Typically used in PyCrypto as an argument (e.g., key, iv)

    :param x: string (does nothing), bytearray, array with numbers
    :return:

def to_bytes(x, blocksize=0):
    """
    Converts input to a byte string.
    Typically used in PyCrypto as an argument (e.g., key, iv)

    :param x: string (does nothing), bytearray, array with numbers
    :return:
    """
    if isinstance(x, bytearray):
        return left_zero_pad(bytes(x), blocksize)
    elif isinstance(x, basestring):
        return left_zero_pad(x, blocksize)
    elif isinstance(x, (list, tuple)):
        return left_zero_pad(bytes(bytearray(x)), blocksize)
    elif isinstance(x, (long, int)):
        return long_to_bytes(x, blocksize)
    else:
        raise ValueError('Unknown input argument type')