"Sputnik" help  
Sputnik Help
PasswordVerify(<password>, <hash>, [<options>])

Description

Verifies whether a given password matches a stored hashed password.

Parameters

<password> The password to be verified.
<hash> The stored hashed password to compare against.
[<options>] Optional array containing additional parameters.

Return Value

Success: Returns true if the password matches the stored hash; otherwise,
Failure: Returns false.

Remarks

The PasswordVerify function is crucial for validating user-entered passwords against stored hashed passwords.

Related

PasswordAlgos, PasswordHash, PasswordInfo, PasswordNeedsRehash

Example

Example of usage:

my $hash = PasswordHash("secret password", @PasswordBCrypt);
say "Hash = $hash";
if (PasswordVerify("secret password", $hash))
    say "Password is correct";
else
    say "Password is invalid";
// PRINTS
// Hash = $2a$10$kf7eOrzJdR/Rvq5T/yZYIe1bYnwUW52Np7TJlZQ.XZfmkO4Yu1506
// Password is correct

 


Contact
Cheryl (uberfox@hotmail.com)
Homepage
http://ubersoft.org