Generates a random token based on the given parameters.
    
    :return     <str>

def generateToken(bits=32):
    """
    Generates a random token based on the given parameters.
    
    :return     <str>
    """
    if bits == 64:
        hasher = hashlib.sha256
    elif bits == 32:
        hasher = hashlib.md5
    else:
        raise StandardError('Unknown bit level.')
    return hasher(nstr(random.getrandbits(256))).hexdigest()