Created
June 2, 2016 07:53
-
-
Save alibitek/1b4271073586bf58f1fecbcc60012f2a to your computer and use it in GitHub Desktop.
Password bcrypt hash verify
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$hash = '<hash goes here>'; | |
$pass = '<password goes here>'; | |
$hash = password_hash($pass, PASSWORD_BCRYPT); | |
echo $hash; | |
if (password_verify($pass, $hash)) { | |
echo 'Password is valid!'; | |
} else { | |
echo 'Invalid password.'; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment