import string
import random


def id_generator(size=6, chars=string.ascii_lowercase + string.digits):
    """GENERATE A RANDOM STRING TO BE USED AS AN ID

    Args:
        size (int, optional): size of the string. Defaults to 6.
        chars (str, optional): charachters to be used to generate the string.
                            Defaults to string.ascii_lowercase+string.digits.

    Returns:
        [str]: a random chain of charachters
    """
    return "".join(random.choice(chars) for _ in range(size))