sedteam / Seditio

Seditio CMS Source

Home Page:https://seditio.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

sed_hash new function add please sha256

SeditioCMS opened this issue · comments

function sed_hash($data, $type = 1, $salt = '')
{
global $cfg;
if (isset($cfg['site_secret']) && !empty($cfg['site_secret']) && ($type == 2))
{
$res = hash('sha256', hash('sha256', $data) . $cfg['site_secret'] . $salt);
}
else
{
$res = ($type == 1) ? hash('sha256', hash('sha256', $data) . $salt) : hash('sha256', $data);
}
return $res;
}