  from django.conf import settings
  from django.utils.encoding import force_bytes
  
  
  def salted_hmac(key_salt, value, secret=None):
      """
      Return the HMAC-SHA1 of 'value', using a key generated from key_salt and a
      secret (which defaults to settings.SECRET_KEY).
  
      A different key_salt should be passed in for every application of HMAC.
 
</s> remove     Return the HMAC-SHA1 of 'value', using a key generated from key_salt and a
    secret (which defaults to settings.SECRET_KEY).
 </s> add     Return the HMAC of 'value', using a key generated from key_salt and a
    secret (which defaults to settings.SECRET_KEY). Default algorithm is SHA1,
    but any algorithm name supported by hashlib.new() can be passed. </s> remove     # passing the key_salt and our base key through a pseudo-random function and
    # SHA1 works nicely.
    key = hashlib.sha1(key_salt + secret).digest()
 </s> add     # passing the key_salt and our base key through a pseudo-random function.
    key = hasher(key_salt + secret).digest() </s> remove from django.utils.crypto import constant_time_compare, pbkdf2, salted_hmac
 </s> add from django.test import SimpleTestCase
from django.utils.crypto import (
    InvalidAlgorithm, constant_time_compare, pbkdf2, salted_hmac,
) </s> remove 
 </s> add     try:
        hasher = getattr(hashlib, algorithm)
    except AttributeError as e:
        raise InvalidAlgorithm(
            '%r is not an algorithm accepted by the hashlib module.'
            % algorithm
        ) from e </s> remove class TestUtilsCryptoMisc(unittest.TestCase):
 </s> add class TestUtilsCryptoMisc(SimpleTestCase):
class InvalidAlgorithm(ValueError):
    """Algorithm is not supported by hashlib."""
    pass


def salted_hmac(key_salt, value, secret=None, *, algorithm='sha1'):
  from django.conf import settings
  from django.utils.encoding import force_bytes
  
  
class InvalidAlgorithm(ValueError):
    """Algorithm is not supported by hashlib."""
    pass


def salted_hmac(key_salt, value, secret=None, *, algorithm='sha1'):
      """
      Return the HMAC-SHA1 of 'value', using a key generated from key_salt and a
      secret (which defaults to settings.SECRET_KEY).
  
      A different key_salt should be passed in for every application of HMAC.
keep keep keep keep replace keep keep keep keep keep
 Refs #27468 -- Added algorithm parameter to django.utils.crypto.salted_hmac(). 
django/utils/crypto.py