werkzeug.check_password_hash(pwhash, password)[source]

check a password against a given salted and hashed password value. In order to support unsalted legacy passwords this method supports plain text passwords, md5 and sha1 hashes (both salted and unsalted).

Returns True if the password matched, False otherwise.

  • pwhash – a hashed string like returned by generate_password_hash().
  • password – the plaintext password to compare against the hash.