<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; use Illuminate\Support\Str; class EncodeUtil { public static function expiredDataForever($WLl1X, $VFU9l) { return self::expiredData($WLl1X, $VFU9l, 0); } public static function expiredData($WLl1X, $VFU9l, $Vq18H = 3600) { goto zZhuv; sJk6q: $AXgEz[] = $M1dp7; goto o6ok5; bkobn: return join('_', $AXgEz); goto lDOqZ; o6ok5: $AXgEz[] = $x2454; goto azhAO; BPmHQ: $d4QjJ = dechex($Vq18H); goto GeI8G; zZhuv: $M1dp7 = bin2hex($WLl1X); goto Ti4fA; azhAO: $AXgEz[] = $BC4yC; goto zAIPL; P58ag: $BC4yC = dechex(time()); goto BPmHQ; Ti4fA: $x2454 = strtolower(Str::random(6)); goto P58ag; GeI8G: $IMKwh = substr(md5($VFU9l . $M1dp7 . $x2454 . $BC4yC . $d4QjJ), 0, 6); goto HbkCe; HbkCe: $AXgEz = array(); goto sJk6q; eij1W: $AXgEz[] = $IMKwh; goto bkobn; zAIPL: $AXgEz[] = $d4QjJ; goto eij1W; lDOqZ: } public static function expiredDataDecode($tpgiq, $VFU9l) { goto EzROY; HXRIK: $x2454 = $qwcyu[1]; goto Zikzb; EzROY: $qwcyu = explode('_', $tpgiq); goto p18TL; uqtv9: if ($IMKwh != $G3aam) { return null; } goto v_uIe; Pr3KZ: if ($Vq18H > 0) { $XK2yJ = hexdec($BC4yC); if (time() > $XK2yJ + $Vq18H) { return null; } } goto KDT9z; ng12Y: $d4QjJ = $qwcyu[3]; goto X3yFa; p18TL: if (count($qwcyu) != 5) { return null; } goto GyQ8A; Zikzb: $BC4yC = $qwcyu[2]; goto ng12Y; X3yFa: $IMKwh = $qwcyu[4]; goto pPlhB; KDT9z: return hex2bin($M1dp7); goto eJLfp; pPlhB: $G3aam = substr(md5($VFU9l . $M1dp7 . $x2454 . $BC4yC . $d4QjJ), 0, 6); goto uqtv9; v_uIe: $Vq18H = hexdec($d4QjJ); goto Pr3KZ; GyQ8A: $M1dp7 = $qwcyu[0]; goto HXRIK; eJLfp: } public static function md5WithSalt($njstY, $cOzEW) { return md5(md5($njstY) . md5($cOzEW)); } public static function detectCharset($BWI89, $gRLX0 = array('gbk', 'utf-8')) { $G_gYS = strtolower(mb_detect_encoding($BWI89, $gRLX0)); switch ($G_gYS) { case 'cp936': return 'gbk'; case 'utf-8': return 'utf-8'; default: return $G_gYS; } } public static function toUTF8($BWI89, $sEjBb = array('gbk', 'utf-8')) { $G_gYS = mb_detect_encoding($BWI89, $sEjBb); return iconv($G_gYS, 'UTF-8', $BWI89); } }