2016-07-21 22:01:57 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Services\Cipher;
|
|
|
|
|
|
|
|
interface EncryptInterface
|
|
|
|
{
|
|
|
|
/**
|
2017-01-08 12:49:32 +08:00
|
|
|
* Encrypt given string with given salt.
|
2016-07-21 22:01:57 +08:00
|
|
|
*
|
2017-01-08 10:48:46 +08:00
|
|
|
* @param string $value
|
2016-07-21 22:01:57 +08:00
|
|
|
* @param string $salt
|
2017-01-08 10:48:46 +08:00
|
|
|
* @return string
|
2016-07-21 22:01:57 +08:00
|
|
|
*/
|
2019-03-02 22:58:37 +08:00
|
|
|
public function hash($value, $salt = '');
|
2017-01-08 12:49:32 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Verifies that the given hash matches the given password.
|
|
|
|
*
|
|
|
|
* @param string $password
|
|
|
|
* @param string $hash
|
|
|
|
* @return bool
|
|
|
|
*/
|
|
|
|
public function verify($password, $hash);
|
2016-07-21 22:01:57 +08:00
|
|
|
}
|