代码拉取完成,页面将自动刷新
同步操作将从 Yc Chan/iWshop 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
<?php
/**
* 数字加密模型
* @description Hope You Do Good But Not Evil
* @copyright Copyright 2014-2015 <ycchen@iwshop.cn>
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
* @author Chenyong Cai <ycchen@iwshop.cn>
* @package Wshop
* @link http://www.iwshop.cn
*/
class DigCrypt {
private $strbase = "Flpvf70CsakVjqgeWUPXQxSyJizmNH6B1u3b8cAEKwTd54nRtZOMDhoG2YLrI";
private $key, $length, $codelen, $codenums, $codeext;
function __construct($length = 9, $key = 2543.5415412812) {
$this->key = $key;
$this->length = $length;
$this->codelen = substr($this->strbase, 0, $this->length);
$this->codenums = substr($this->strbase, $this->length, 10);
$this->codeext = substr($this->strbase, $this->length + 10);
}
function en($nums) {
$rtn = "";
$numslen = strlen($nums);
//密文第一位标记数字的长度
$begin = substr($this->codelen, $numslen - 1, 1);
//密文的扩展位
$extlen = $this->length - $numslen - 1;
$temp = str_replace('.', '', $nums / $this->key);
$temp = substr($temp, -$extlen);
$arrextTemp = str_split($this->codeext);
$arrext = str_split($temp);
foreach ($arrext as $v) {
$rtn .= $arrextTemp[$v];
}
$arrnumsTemp = str_split($this->codenums);
$arrnums = str_split($nums);
foreach ($arrnums as $v) {
$rtn .= $arrnumsTemp[$v];
}
return $begin . $rtn;
}
function de($code) {
if (!$code) {
return false;
}
$begin = substr($code, 0, 1);
$rtn = '';
$len = strpos($this->codelen, $begin);
if ($len !== false) {
$len++;
$arrnums = str_split(substr($code, -$len));
foreach ($arrnums as $v) {
$rtn .= strpos($this->codenums, $v);
}
}
return $rtn;
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。