def str2bits(str_in):
    """
    Convert string input to bits.
    :param str_in: input string
    :return: bits array
    """
    result = []
    for c in str_in:
        bits = bin(ord(c))[2:]
        bits = '00000000'[len(bits):] + bits
        result.extend([int(b) for b in bits])
    return result