import random


def token(length=64):
    """Generates a random token of length 'length'"""
    s = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"
    r = ""
    for i in range(length):
        r += s[int(random.random() * len(s))]
    return r