Skip to content

Instantly share code, notes, and snippets.

@MasterHans
Created October 21, 2016 13:34
Show Gist options
  • Save MasterHans/f72f0b5e4750a9737681abed7586c310 to your computer and use it in GitHub Desktop.
Save MasterHans/f72f0b5e4750a9737681abed7586c310 to your computer and use it in GitHub Desktop.
<?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