<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; use Illuminate\Support\Str; class EncodeUtil { public static function expiredDataForever($jFNXP, $HQKqq) { return self::expiredData($jFNXP, $HQKqq, 0); } public static function expiredData($jFNXP, $HQKqq, $mJFDb = 3600) { goto eXT1n; kF7fg: $pFM9U[] = $X5n42; goto WLSpP; WLSpP: $pFM9U[] = $aLU1a; goto Ru1Oi; htdDj: $pFM9U[] = $QfH0p; goto kF7fg; mE7fv: $pFM9U = array(); goto INp1J; BwSkl: return join('_', $pFM9U); goto G8g5v; INp1J: $pFM9U[] = $pxoak; goto htdDj; WjLJ3: $X5n42 = dechex(time()); goto teU6X; Ru1Oi: $pFM9U[] = $H8a6_; goto BwSkl; teU6X: $aLU1a = dechex($mJFDb); goto Z04mh; eXT1n: $pxoak = bin2hex($jFNXP); goto G_QWT; G_QWT: $QfH0p = strtolower(Str::random(6)); goto WjLJ3; Z04mh: $H8a6_ = substr(md5($HQKqq . $pxoak . $QfH0p . $X5n42 . $aLU1a), 0, 6); goto mE7fv; G8g5v: } public static function expiredDataDecode($iERFh, $HQKqq) { goto EGr0F; EGr0F: $PhYE_ = explode('_', $iERFh); goto qybfC; GT9UN: $X5n42 = $PhYE_[2]; goto gpnlv; hVbEZ: if ($mJFDb > 0) { $B0q5s = hexdec($X5n42); if (time() > $B0q5s + $mJFDb) { return null; } } goto cLsqP; gpnlv: $aLU1a = $PhYE_[3]; goto ptMTL; ptMTL: $H8a6_ = $PhYE_[4]; goto vBIL4; oJcjR: if ($H8a6_ != $tGCeC) { return null; } goto qAOa5; qybfC: if (count($PhYE_) != 5) { return null; } goto eey25; eey25: $pxoak = $PhYE_[0]; goto CsC9f; qAOa5: $mJFDb = hexdec($aLU1a); goto hVbEZ; cLsqP: return hex2bin($pxoak); goto Amhka; vBIL4: $tGCeC = substr(md5($HQKqq . $pxoak . $QfH0p . $X5n42 . $aLU1a), 0, 6); goto oJcjR; CsC9f: $QfH0p = $PhYE_[1]; goto GT9UN; Amhka: } public static function md5WithSalt($f8snf, $ui8EZ) { return md5(md5($f8snf) . md5($ui8EZ)); } public static function detectCharset($LTC5O, $W547D = array('gbk', 'utf-8')) { $CXfjY = strtolower(mb_detect_encoding($LTC5O, $W547D)); switch ($CXfjY) { case 'cp936': return 'gbk'; case 'utf-8': return 'utf-8'; default: return $CXfjY; } } public static function toUTF8($LTC5O, $xUo9e = array('gbk', 'utf-8')) { $CXfjY = mb_detect_encoding($LTC5O, $xUo9e); return iconv($CXfjY, 'UTF-8', $LTC5O); } }