def GeneratePasswordHash(password):
 if (len(password) < 8):
  raise InvalidRequestError(_PASSWORD_TOO_SHORT)
 salt = base64.b64encode(os.urandom(16))
 pwd_hash = HashPassword(password, salt)
 return (pwd_hash, salt)

def GeneratePasswordHash ( password ) : if ( len ( password ) < 8 ) : raise InvalidRequestError ( _PASSWORD_TOO_SHORT ) salt = base64 . b64encode ( os . urandom ( 16 ) ) pwd_hash = HashPassword ( password , salt ) return ( pwd_hash , salt )
generates a password hash from the given password str .