Last active
January 14, 2018 06:22
-
-
Save YurePereira/56a4d0330588ef5c6f5774ea8abf4239 to your computer and use it in GitHub Desktop.
Comparando uma senha hash com uma senha entrada,
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 | |
| //Senha supostamente obtida por um banco de dados: | |
| $hashPassword = '$2y$11$60E.YbPVdujZB5pt71C51.FTKINFQnkdyPFttgeRtLdUbOlZTD0.S'; | |
| //Senha supostamente entrada por usuário para comparação: | |
| $passwordInput = 'myPassword'; | |
| if (password_verify($passwordInput, $hashPassword)) { | |
| echo 'Senha correta!'; | |
| } else { | |
| echo 'Senha incorreta!'; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment