<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; use Illuminate\Support\Str; class EncodeUtil { public static function expiredDataForever($W8D7a, $l6tBV) { return self::expiredData($W8D7a, $l6tBV, 0); } public static function expiredData($W8D7a, $l6tBV, $XnmHw = 3600) { goto UhwCE; UINvt: $ACVUe[] = $Umq3P; goto xXZ3C; HJiSq: $ACVUe = array(); goto UINvt; xXZ3C: $ACVUe[] = $aXF4i; goto vPq63; vnrhy: return join('_', $ACVUe); goto O54yM; LHc0G: $Pmdhe = substr(md5($l6tBV . $Umq3P . $aXF4i . $tYuM5 . $wbJtY), 0, 6); goto HJiSq; csQoD: $tYuM5 = dechex(time()); goto zHsFT; grMbj: $ACVUe[] = $wbJtY; goto fIHrx; vPq63: $ACVUe[] = $tYuM5; goto grMbj; GpvuA: $aXF4i = strtolower(Str::random(6)); goto csQoD; zHsFT: $wbJtY = dechex($XnmHw); goto LHc0G; fIHrx: $ACVUe[] = $Pmdhe; goto vnrhy; UhwCE: $Umq3P = bin2hex($W8D7a); goto GpvuA; O54yM: } public static function expiredDataDecode($ik1Qg, $l6tBV) { goto D1IPG; LkNVU: $XnmHw = hexdec($wbJtY); goto a084m; QCL2k: $tYuM5 = $NKf8K[2]; goto pkd8F; pkd8F: $wbJtY = $NKf8K[3]; goto MDeL6; MDeL6: $Pmdhe = $NKf8K[4]; goto EmhZ6; d3G5U: return hex2bin($Umq3P); goto TN2F4; a084m: if ($XnmHw > 0) { $PmxdV = hexdec($tYuM5); if (time() > $PmxdV + $XnmHw) { return null; } } goto d3G5U; Buk12: $aXF4i = $NKf8K[1]; goto QCL2k; EmhZ6: $xD6dl = substr(md5($l6tBV . $Umq3P . $aXF4i . $tYuM5 . $wbJtY), 0, 6); goto AvU7d; qy00b: $Umq3P = $NKf8K[0]; goto Buk12; D1IPG: $NKf8K = explode('_', $ik1Qg); goto IoWcU; AvU7d: if ($Pmdhe != $xD6dl) { return null; } goto LkNVU; IoWcU: if (count($NKf8K) != 5) { return null; } goto qy00b; TN2F4: } public static function md5WithSalt($V3jYa, $gnh2a) { return md5(md5($V3jYa) . md5($gnh2a)); } public static function detectCharset($vVYCS, $VKU5K = array('gbk', 'utf-8')) { $dE9uS = strtolower(mb_detect_encoding($vVYCS, $VKU5K)); switch ($dE9uS) { case 'cp936': return 'gbk'; case 'utf-8': return 'utf-8'; default: return $dE9uS; } } public static function toUTF8($vVYCS, $qmCIi = array('gbk', 'utf-8')) { $dE9uS = mb_detect_encoding($vVYCS, $qmCIi); return iconv($dE9uS, 'UTF-8', $vVYCS); } }