def randomId(size=6, chars=None):
    """generates a random string of letters and numbers"""
    import random, string
    if not chars:
        chars = string.ascii_lowercase + string.digits
    return ''.join(random.choice(chars) for x in range(size))
