Created
January 27, 2013 14:02
-
-
Save ischenkodv/4648444 to your computer and use it in GitHub Desktop.
Usage of Zend\Crypt to generate and verify password hash.
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
// Create hash | |
$bcrypt = new Bcrypt(); | |
$bcrypt->setSalt('abcdefghijklmnopqrstufwxyz'); | |
$password = 'dima'; | |
$hash = $bcrypt->create($password); | |
// Verify password | |
if ($bcrypt->verify($password, $hash)) { | |
echo "And there was much rejoicing"; | |
} else { | |
echo "No shrubbery for you"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment