code: def shadow_hash(crypt_salt=None, password=None, algorithm='sha512'):
      '''
      Generates a salted hash suitable for /etc/shadow.
  
      crypt_salt : None
          Salt to be used in the generation of the hash. If one is not
          provided, a random salt will be generated.
  
      password : None
          Value to be salted and hashed. If one is not provided, a random
          password will be generated.
  
      algorithm : sha512
          Hash algorithm to use.
  
      CLI Example:
  
      .. code-block:: bash
  
          salt '*' random.shadow_hash 'My5alT' 'MyP@asswd' md5
      '''
      return salt.utils.pycrypto.gen_hash(crypt_salt, password, algorithmf shadow_hash(crypt_salt=None, password=None, algorithm='sha512'):
      '''
      Generates a salted hash suitable for /etc/shadow.
  
      crypt_salt : None
          Salt to be used in the generation of the hash. If one is not
          provided, a random salt will be generated.
  
      password : None
          Value to be salted and hashed. If one is not provided, a random
          password will be generated.
  
      algorithm : sha512
          Hash algorithm to use.
  
      CLI Example:
  
      .. code-block:: bash
  
          salt '*' random.shadow_hash 'My5alT' 'MyP@asswd' md5
      '''
      return salt.utils.pycrypto.gen_hash(crypt_salt, password, algorithm)
docs: Generates a salted hash suitable for /etc/shadow.
  
      crypt_salt : None
          Salt to be used in the generation of the hash. If one is not
          provided, a random salt will be generated.
  
      password : None
          Value to be salted and hashed. If one is not provided, a random
          password will be generated.
  
      algorithm : sha512
          Hash algorithm to use.
  
      CLI Example:
  
      .. code-block:: bash
  
          salt '*' random.shadow_hash 'My5alT' 'MyP@asswd' md5