import random


def random_seed(chars, nb_chars):
    """
    Generate a random string.

    :param chars: list of characters used to generate the string
    :param nb_chars: length of the generated string
    :return: random string
    """
    s = ''
    for i in range(nb_chars):
        s += chars[random.randint(0, len(chars) - 1)]

    return s