code: def verify(password, hash):
      
      _, algorithm, cost, salt, password_hash = hash.split("$")
  
      password = pbkdf2.pbkdf2_hex(password, salt, int(cost) * 500)
  
      return _safe_str_cmp(password, password_hash)
docs: Verify a password against a passed hash