def make_password(password, salt=None, hasher='default'):
 if (not password):
  return UNUSABLE_PASSWORD
 hasher = get_hasher(hasher)
 password = smart_str(password)
 if (not salt):
  salt = hasher.salt()
 salt = smart_str(salt)
 return hasher.encode(password, salt)

def make_password ( password , salt = None , hasher = 'default' ) : if ( not password ) : return UNUSABLE_PASSWORD hasher = get_hasher ( hasher ) password = smart_str ( password ) if ( not salt ) : salt = hasher . salt ( ) salt = smart_str ( salt ) return hasher . encode ( password , salt )
turn a plain-text password into a hash for database storage same as encode() but generates a new random salt .