2016-10-30 14:12:22 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Services\Cipher;
|
|
|
|
|
2016-11-05 20:10:46 +08:00
|
|
|
class SALTED2SHA256 implements EncryptInterface
|
2016-10-30 14:12:22 +08:00
|
|
|
{
|
|
|
|
/**
|
2017-01-08 10:48:46 +08:00
|
|
|
* SHA256 hash with salt
|
2016-10-30 14:12:22 +08:00
|
|
|
*/
|
2017-01-08 10:48:46 +08:00
|
|
|
public function encrypt($value, $salt = "")
|
|
|
|
{
|
|
|
|
return hash('sha256', hash('sha256', $value).$salt);
|
2016-10-30 14:12:22 +08:00
|
|
|
}
|
|
|
|
}
|