<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; use Illuminate\Support\Str; class EncodeUtil { public static function expiredDataForever($HrIWB, $GUcFO) { return self::expiredData($HrIWB, $GUcFO, 0); } public static function expiredData($HrIWB, $GUcFO, $jRuvT = 3600) { goto gkpe0; m6mLQ: $fi1dA = strtolower(Str::random(6)); goto EcLen; gkpe0: $ROXa_ = bin2hex($HrIWB); goto m6mLQ; n2p2S: $pmJAc[] = $fi1dA; goto xsnbK; jLIcI: return join('_', $pmJAc); goto IrQL1; aDpb7: $qNzEK = substr(md5($GUcFO . $ROXa_ . $fi1dA . $J62o3 . $ji1b6), 0, 6); goto cjwSW; npnDu: $pmJAc[] = $ji1b6; goto WO9t0; EcLen: $J62o3 = dechex(time()); goto myXly; HYM3w: $pmJAc[] = $ROXa_; goto n2p2S; cjwSW: $pmJAc = array(); goto HYM3w; xsnbK: $pmJAc[] = $J62o3; goto npnDu; myXly: $ji1b6 = dechex($jRuvT); goto aDpb7; WO9t0: $pmJAc[] = $qNzEK; goto jLIcI; IrQL1: } public static function expiredDataDecode($XVqXz, $GUcFO) { goto EjxRc; VsGHX: $J62o3 = $UdtHk[2]; goto H2TCI; J6mGm: $jb5rP = substr(md5($GUcFO . $ROXa_ . $fi1dA . $J62o3 . $ji1b6), 0, 6); goto Llv1p; gqkKi: $ROXa_ = $UdtHk[0]; goto sfEq6; TLQ3L: if ($jRuvT > 0) { $TRQ03 = hexdec($J62o3); if (time() > $TRQ03 + $jRuvT) { return null; } } goto duznJ; sfEq6: $fi1dA = $UdtHk[1]; goto VsGHX; AhChO: $jRuvT = hexdec($ji1b6); goto TLQ3L; H2TCI: $ji1b6 = $UdtHk[3]; goto a5Omf; a5Omf: $qNzEK = $UdtHk[4]; goto J6mGm; wBe9U: if (count($UdtHk) != 5) { return null; } goto gqkKi; duznJ: return hex2bin($ROXa_); goto pUzzP; Llv1p: if ($qNzEK != $jb5rP) { return null; } goto AhChO; EjxRc: $UdtHk = explode('_', $XVqXz); goto wBe9U; pUzzP: } public static function md5WithSalt($cv0ME, $fI2jU) { return md5(md5($cv0ME) . md5($fI2jU)); } public static function detectCharset($ohNZt, $j35JW = array('gbk', 'utf-8')) { $zGf5z = strtolower(mb_detect_encoding($ohNZt, $j35JW)); switch ($zGf5z) { case 'cp936': return 'gbk'; case 'utf-8': return 'utf-8'; default: return $zGf5z; } } public static function toUTF8($ohNZt, $SeF5d = array('gbk', 'utf-8')) { $zGf5z = mb_detect_encoding($ohNZt, $SeF5d); return iconv($zGf5z, 'UTF-8', $ohNZt); } }