

def salted_hmac(key_salt, value, secret=None):
    "\n    Returns the HMAC-SHA1 of 'value', using a key generated from key_salt and a\n    secret (which defaults to settings.SECRET_KEY).\n\n    A different key_salt should be passed in for every application of HMAC.\n    "
    if (secret is None):
        secret = settings.SECRET_KEY
    key = hashlib.sha1((key_salt + secret).encode('utf-8')).digest()
    return hmac.new(key, msg=force_bytes(value), digestmod=hashlib.sha1)

dataset/ETHPy150Open cloudera/hue/desktop/core/ext-py/Django-1.6.10/django/utils/crypto.py salted_hmac/original