import random


def _generate_fwf_row(characterSet, offsets):
    """Generates a random fwf line

    Args:
        characterSet (str): valid to pick characters from
        offsets (list[int]): lengths of each field

    Returns:
        line(str): line formatted in fwf
    """
    return [
        "".join(random.choices(characterSet, k=random.randint(0, off)))  # nosec
        for off in offsets
    ]