import random


def generate_single_row(row_id):
    """
    This will produce a single row with 100 bytes composed of the following:

    <10 bytes random key> <10 bytes of the row ID> <78 bytes of random data><newline character>

    :param row_id:
    :return:
    """
    list_of_bytes = []

    # First 10 bytes of random ints
    list_of_bytes.extend([random.randint(0, 9) for element in range(10)])

    right_justified_row_id = str(row_id).rjust(10, '0')

    # Next 10 bytes will be based off row id
    list_of_bytes.extend([int(right_justified_row_id[index]) for index in range(len(right_justified_row_id))])

    # 78 bytes of random data
    list_of_bytes.extend([random.randint(0, 9) for iteration in range(78)])

    return bytes(list_of_bytes)