1.生成密码 password_hash('test_password',PASSWORD_DEFAULT)
2.密码检验
$hash = '$2y$10$ckeTXO/nnKfWTDDYRSwGWu0xste/55Cp0RIpolBldDOXZ61ecZxcG';//通过1过程生成的密码hash if (password_verify('test_password', $hash)) { echo 'ok!'; } else { echo 'fail.'; }
1.生成密码 password_hash('test_password',PASSWORD_DEFAULT)
2.密码检验
$hash = '$2y$10$ckeTXO/nnKfWTDDYRSwGWu0xste/55Cp0RIpolBldDOXZ61ecZxcG';//通过1过程生成的密码hash if (password_verify('test_password', $hash)) { echo 'ok!'; } else { echo 'fail.'; }