import string
import random


def randomstring(size=8, chars=string.ascii_lowercase + string.digits):
    """
    Generates a random string of *size characters

    :param size: number of characters. Default value = 8
    :param chars: Type of characters. Default letters and numbers
    :return: Random string of *size characters
    """
    return ''.join(random.choice(chars) for _ in range(size))