def pad_zeros(data, max_bytes):
    """ Pad extra zeros and data

    If the data capacity isn't fully used,
    a terminator pattern is added at the end (0000).
    When there is less than 4 bits left,
    the rest of the space is filled with zeros.
    After that, the data is filled with zeros,
    to make the length a multiple of eight.
    When there is still space left,
    the "no data" pattern is added:
    (11101100 and 00010001 alternated)
    """
    spare_bits = max_bytes - len(data)
    if spare_bits > 4:
        data += "0" * 4
    else:
        data += "0" * spare_bits
    if len(data) % 8 != 0:
        pad_to_eight_number = 8 - len(data) % 8
        data += "0" * pad_to_eight_number
    while len(data) < max_bytes:
        data += "11101100"
        if len(data) < max_bytes:
            data += "00010001"
    return data