Comment verify_password

This commit is contained in:
Starbeamrainbowlabs 2018-05-11 11:36:29 +01:00
parent c64aaa72db
commit 62dff18b4d
Signed by: sbrl
GPG Key ID: 1BE5172E637709C2
1 changed files with 6 additions and 1 deletions

View File

@ -217,7 +217,12 @@ function hash_password($pass) {
$props["options"]
);
}
/**
* Verifies a user's password against a pre-generated hash.
* @param string $pass The user's password.
* @param string $hash The hash to compare against.
* @return bool Whether the password matches the has or not.
*/
function verify_password($pass, $hash) {
$pass_transformed = base64_encode(hash("sha384", $pass));
return password_verify($pass_transformed, $hash);