Skip to main content

check_password

Return a boolean of whether the raw password matches the three part encoded digest.

If setter is specified, it'll be called when you need to regenerate the
password.
def check_password(
password: string,
encoded: string,
setter: callable = null,
preferred: string = "default"
) - > boolean

Return a boolean of whether the raw password matches the three part encoded digest. If setter is specified, it'll be called when you need to regenerate the password.

Parameters

NameTypeDescription
passwordstringThe raw, unencrypted password string to be verified
encodedstringThe three-part encoded digest string to compare against
settercallable = nullAn optional callback function invoked with the raw password to update the stored hash if the current encoding is deprecated
preferredstring = "default"The preferred hashing algorithm or configuration to check against for potential re-encoding

Returns

TypeDescription
booleanTrue if the raw password matches the encoded digest, False otherwise