Created
October 21, 2016 13:34
-
-
Save MasterHans/f72f0b5e4750a9737681abed7586c310 to your computer and use it in GitHub Desktop.
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 | |
require 'password.php'; | |
$passwordHash = password_hash('secret-password', PASSWORD_DEFAULT); | |
if (password_verify('bad-password', $passwordHash)) { | |
//Правильный пароль | |
} else { | |
//Неправильный пароль | |
} | |
password_hash - есть опция solt - можно не указывать сгенерит сама функция по умолчанию |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment