2017-01-08 12:49:32 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Services\Cipher;
|
|
|
|
|
|
|
|
abstract class BaseCipher implements EncryptInterface
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* {@inheritdoc}
|
|
|
|
*/
|
2019-03-02 22:58:37 +08:00
|
|
|
public function hash($value, $salt = '')
|
2017-01-08 12:49:32 +08:00
|
|
|
{
|
|
|
|
//
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* {@inheritdoc}
|
|
|
|
*/
|
2019-03-02 22:58:37 +08:00
|
|
|
public function verify($password, $hash, $salt = '')
|
2017-01-08 12:49:32 +08:00
|
|
|
{
|
2017-01-08 13:44:03 +08:00
|
|
|
return hash_equals($hash, $this->hash($password, $salt));
|
2017-01-08 12:49:32 +08:00
|
|
|
}
|
|
|
|
}
|