def salted_hmac(key_salt, value, secret=None):
 if (secret is None):
  secret = settings.SECRET_KEY
 key_salt = force_bytes(key_salt)
 secret = force_bytes(secret)
 key = hashlib.sha1((key_salt + secret)).digest()
 return hmac.new(key, msg=force_bytes(value), digestmod=hashlib.sha1)

def salted_hmac ( key_salt , value , secret = None ) : if ( secret is None ) : secret = settings . SECRET_KEY key_salt = force_bytes ( key_salt ) secret = force_bytes ( secret ) key = hashlib . sha1 ( ( key_salt + secret ) ) . digest ( ) return hmac . new ( key , msg = force_bytes ( value ) , digestmod = hashlib . sha1 )
returns the hmac-sha1 of value .