import random


def generate_random_token(length=64):
    """ Generates a random token of specified length.
    """

    lrange = 16 ** length
    hexval = "%0{}x".format(length)
    return hexval % (random.randrange(lrange))