def ldap_hash_password(password):
 password_utf8 = trunc_password(password).encode('utf-8')
 h = passlib.hash.ldap_salted_sha1.encrypt(password_utf8)
 return h

def ldap_hash_password ( password ) : password_utf8 = trunc_password ( password ) . encode ( 'utf-8' ) h = passlib . hash . ldap_salted_sha1 . encrypt ( password_utf8 ) return h
hash a password .