2017-01-08 12:49:32 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Services\Cipher;
|
|
|
|
|
|
|
|
class PHP_PASSWORD_HASH extends BaseCipher
|
|
|
|
{
|
2019-03-02 22:58:37 +08:00
|
|
|
public function hash($value, $salt = '')
|
2017-01-08 12:49:32 +08:00
|
|
|
{
|
|
|
|
return password_hash($value, PASSWORD_DEFAULT);
|
|
|
|
}
|
|
|
|
|
2019-03-02 22:58:37 +08:00
|
|
|
public function verify($password, $hash, $salt = '')
|
2017-01-08 12:49:32 +08:00
|
|
|
{
|
|
|
|
return password_verify($password, $hash);
|
|
|
|
}
|
|
|
|
}
|