2016-04-03 15:39:22 +08:00
|
|
|
<?php
|
|
|
|
|
2016-07-21 22:01:57 +08:00
|
|
|
namespace App\Services\Cipher;
|
2016-04-03 15:39:22 +08:00
|
|
|
|
|
|
|
class SHA256 implements EncryptInterface
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Default SHA256 encryption method for Authme
|
|
|
|
*
|
|
|
|
* @see http://pastebin.com/1wy9g2HT
|
|
|
|
*/
|
2016-07-21 22:01:57 +08:00
|
|
|
public function encrypt($raw_passwd, $salt = "") {
|
2016-04-03 15:39:22 +08:00
|
|
|
$encrypt = hash('sha256', hash('sha256', $raw_passwd).$salt);
|
|
|
|
return $encrypt;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|