def chunks(it: bytes, chunk_size: int=255):
    """ Iterate bytes(it) into chunks of chunk_size """
    assert type(it) == bytes
    it_size = len(it)
    if it_size <= chunk_size:
        yield it
    else:
        chunk_count = it_size // chunk_size
        remainder = it_size % chunk_size
        for i in range(0, chunk_count, chunk_size):
            yield it[i:i + chunk_size]
        final_offset = chunk_count * chunk_size
        yield it[final_offset:final_offset + remainder]
