<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; use Illuminate\Support\Str; class EncodeUtil { public static function expiredDataForever($CzxDH, $oMJcb) { return self::expiredData($CzxDH, $oMJcb, 0); } public static function expiredData($CzxDH, $oMJcb, $F3pB9 = 3600) { goto f5m9Y; NnpCG: $mattM[] = $IBgIL; goto d5c40; orX7q: return join('_', $mattM); goto K27Vd; f5m9Y: $khIIy = bin2hex($CzxDH); goto ArvgH; xSCH2: $p3maz = dechex($F3pB9); goto C9Hsq; XWX22: $mattM[] = $p3maz; goto vqeGG; vLk2I: $IlwSp = dechex(time()); goto xSCH2; vqeGG: $mattM[] = $IPTJ8; goto orX7q; liVJ_: $mattM = array(); goto EVLzD; EVLzD: $mattM[] = $khIIy; goto NnpCG; d5c40: $mattM[] = $IlwSp; goto XWX22; C9Hsq: $IPTJ8 = substr(md5($oMJcb . $khIIy . $IBgIL . $IlwSp . $p3maz), 0, 6); goto liVJ_; ArvgH: $IBgIL = strtolower(Str::random(6)); goto vLk2I; K27Vd: } public static function expiredDataDecode($CzxDH, $oMJcb) { goto AXXq7; cnEeT: if (count($bW0Md) != 5) { return null; } goto OKHXo; GuL86: if ($F3pB9 > 0) { $YyV6N = hexdec($IlwSp); if (time() > $YyV6N + $F3pB9) { return null; } } goto RwywI; o2Rzc: $IlwSp = $bW0Md[2]; goto tS2Vs; OKHXo: $khIIy = $bW0Md[0]; goto AqwHs; sNkic: $IPTJ8 = $bW0Md[4]; goto K0G1O; JckXP: if ($IPTJ8 != $XaOcL) { return null; } goto O6ISW; O6ISW: $F3pB9 = hexdec($p3maz); goto GuL86; K0G1O: $XaOcL = substr(md5($oMJcb . $khIIy . $IBgIL . $IlwSp . $p3maz), 0, 6); goto JckXP; RwywI: return hex2bin($khIIy); goto Kkyu7; AXXq7: $bW0Md = explode('_', $CzxDH); goto cnEeT; AqwHs: $IBgIL = $bW0Md[1]; goto o2Rzc; tS2Vs: $p3maz = $bW0Md[3]; goto sNkic; Kkyu7: } public static function md5WithSalt($wjfbs, $isiSF) { return md5(md5($wjfbs) . md5($isiSF)); } public static function detectCharset($gP2DQ, $zAXbf = array('gbk', 'utf-8')) { $Os2Um = strtolower(mb_detect_encoding($gP2DQ, $zAXbf)); switch ($Os2Um) { case 'cp936': return 'gbk'; case 'utf-8': return 'utf-8'; default: return $Os2Um; } } public static function toUTF8($gP2DQ, $GNrCe = array('gbk', 'utf-8')) { $Os2Um = mb_detect_encoding($gP2DQ, $GNrCe); return iconv($Os2Um, 'UTF-8', $gP2DQ); } }