<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; use Illuminate\Support\Str; class EncodeUtil { public static function expiredDataForever($i7B59, $ax5t3) { return self::expiredData($i7B59, $ax5t3, 0); } public static function expiredData($i7B59, $ax5t3, $u13ss = 3600) { goto iE2To; vLqU2: $Kp99R[] = $AMA1k; goto DLVC0; vhdg7: $rRCSS = strtolower(Str::random(6)); goto iPR6d; iPR6d: $uf17h = dechex(time()); goto lVPjT; lVPjT: $AMA1k = dechex($u13ss); goto dl3Yl; lmFmi: $Kp99R[] = $rRCSS; goto wi0hy; wi0hy: $Kp99R[] = $uf17h; goto vLqU2; dl3Yl: $fryoH = substr(md5($ax5t3 . $V7ODi . $rRCSS . $uf17h . $AMA1k), 0, 6); goto g2L3V; DLVC0: $Kp99R[] = $fryoH; goto VI4r7; iE2To: $V7ODi = bin2hex($i7B59); goto vhdg7; QHrv9: $Kp99R[] = $V7ODi; goto lmFmi; VI4r7: return join('_', $Kp99R); goto jXpgv; g2L3V: $Kp99R = array(); goto QHrv9; jXpgv: } public static function expiredDataDecode($xIfit, $ax5t3) { goto HM8lM; XDZzk: if ($u13ss > 0) { $tfKvy = hexdec($uf17h); if (time() > $tfKvy + $u13ss) { return null; } } goto BY_HK; S0Sg5: if ($fryoH != $uVev_) { return null; } goto BMzl_; dwcTp: $uVev_ = substr(md5($ax5t3 . $V7ODi . $rRCSS . $uf17h . $AMA1k), 0, 6); goto S0Sg5; D2dFc: $uf17h = $Mc7y1[2]; goto q6mhX; xGqkB: $rRCSS = $Mc7y1[1]; goto D2dFc; wMyve: $V7ODi = $Mc7y1[0]; goto xGqkB; q6mhX: $AMA1k = $Mc7y1[3]; goto tlG65; BY_HK: return hex2bin($V7ODi); goto vAQXI; tlG65: $fryoH = $Mc7y1[4]; goto dwcTp; BMzl_: $u13ss = hexdec($AMA1k); goto XDZzk; q0Vs1: if (count($Mc7y1) != 5) { return null; } goto wMyve; HM8lM: $Mc7y1 = explode('_', $xIfit); goto q0Vs1; vAQXI: } public static function md5WithSalt($wX62V, $WBXlW) { return md5(md5($wX62V) . md5($WBXlW)); } public static function detectCharset($rFmqf, $Hvifc = array('gbk', 'utf-8')) { $tG33t = strtolower(mb_detect_encoding($rFmqf, $Hvifc)); switch ($tG33t) { case 'cp936': return 'gbk'; case 'utf-8': return 'utf-8'; default: return $tG33t; } } public static function toUTF8($rFmqf, $wAw3n = array('gbk', 'utf-8')) { $tG33t = mb_detect_encoding($rFmqf, $wAw3n); return iconv($tG33t, 'UTF-8', $rFmqf); } }