PHP加密

function encry($value,$type=0)
{
    \think\Config::load('../application/common/config.php');
    $key = md5(\think\Config::get('key'));
    if($type)
    {
        return str_replace('=','',base64_encode($value ^ $key));
    } else {
        $value = base64_decode($value);
        return $value ^ $key;
    }

}

猜你喜欢

转载自my.oschina.net/u/3483680/blog/1825902