Created
November 16, 2018 04:40
-
-
Save ErMandeep/6964801c3e6951d4fee53da231910561 to your computer and use it in GitHub Desktop.
This file contains 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 | |
/** | |
* In this case, we want to increase the default cost for BCRYPT to 12. | |
* Note that we also switched to BCRYPT, which will always be 60 characters. | |
*/ | |
$options = [ | |
'cost' => 12, | |
]; | |
$hash1 = password_hash("mandeep", PASSWORD_BCRYPT, $options); | |
echo $hash1. "<br>"; | |
// $hash = '$2y$07$BCryptRequires22Chrcte/VlQH0piJtjXl.0t1XkA8pw9dMXTpOq'; | |
if (password_verify('mandeep', $hash1)) { | |
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