src/admin_toolbelt/ldap_client.py
def hash_password(cls, passwd):
        """Given a string passwd, returns the hash of the string with a random 
        salt and formatted to be suitable for use as the value of userPassword.
        """
        h = hashlib.new('sha1', passwd.encode('utf-8'))
        salt = os.urandom(16)
        h.update(salt)
        return ("{SSHA}" + base64.encodebytes(h.digest() + salt).decode().strip()).encode('utf-8')
Given a string passwd, returns the hash of the string with a random 
        salt and formatted to be suitable for use as the value of userPassword.
        
Given a string passwd, returns the hash of the string with a random
salt and formatted to be suitable for use as the value of userPassword.
Given a string passwd returns the hash of the string with a random salt and formatted to be suitable for use as the value of userPassword .
def hash_password(cls, passwd):
        h = hashlib.new('sha1', passwd.encode('utf-8'))
        salt = os.urandom(16)
        h.update(salt)
        return ("{SSHA}" + base64.encodebytes(h.digest() + salt).decode().strip()).encode('utf-8')
def hash_password ( cls , passwd ) : h = hashlib . new ( 'sha1' , passwd . encode ( 'utf-8' ) ) salt = os . urandom ( 16 ) h . update ( salt ) return ( "{SSHA}" + base64 . encodebytes ( h . digest ( ) + salt ) . decode ( ) . strip ( ) ) . encode ( 'utf-8' )
Given a string passwd, returns the hash of the string with a random
salt and formatted to be suitable for use as the value of userPassword.
Given a string passwd returns the hash of the string with a random salt and formatted to be suitable for use as the value of userPassword .
"""Given a string passwd, returns the hash of the string with a random 
        salt and formatted to be suitable for use as the value of userPassword.
        """
cls
passwd