<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; use Illuminate\Support\Str; class EncodeUtil { public static function expiredDataForever($gtzum, $jPfeB) { return self::expiredData($gtzum, $jPfeB, 0); } public static function expiredData($gtzum, $jPfeB, $f2fpJ = 3600) { goto DiVk_; ld7kQ: $qHLCM[] = $ulOzB; goto EHXN_; EHXN_: $qHLCM[] = $w4EDX; goto CyBtU; w3qoY: $qHLCM[] = $bWhL4; goto u_7dQ; DiVk_: $Lj2sx = bin2hex($gtzum); goto yS0g9; JX_nN: $qHLCM = array(); goto dvWfY; u_7dQ: $qHLCM[] = $FHwN6; goto ld7kQ; CyBtU: return join('_', $qHLCM); goto wNmXt; yS0g9: $bWhL4 = strtolower(Str::random(6)); goto OJuBc; inwVV: $w4EDX = substr(md5($jPfeB . $Lj2sx . $bWhL4 . $FHwN6 . $ulOzB), 0, 6); goto JX_nN; OJuBc: $FHwN6 = dechex(time()); goto DVB2i; dvWfY: $qHLCM[] = $Lj2sx; goto w3qoY; DVB2i: $ulOzB = dechex($f2fpJ); goto inwVV; wNmXt: } public static function expiredDataDecode($m2Dmo, $jPfeB) { goto j8SUP; j8SUP: $z8JHA = explode('_', $m2Dmo); goto QlvOM; LB6p5: $mKyzr = substr(md5($jPfeB . $Lj2sx . $bWhL4 . $FHwN6 . $ulOzB), 0, 6); goto pw7Rl; To0wB: $w4EDX = $z8JHA[4]; goto LB6p5; XG2nd: $bWhL4 = $z8JHA[1]; goto ODsq1; obXfa: if ($f2fpJ > 0) { $kpbbP = hexdec($FHwN6); if (time() > $kpbbP + $f2fpJ) { return null; } } goto Z8p0Q; tWm9H: $ulOzB = $z8JHA[3]; goto To0wB; QlvOM: if (count($z8JHA) != 5) { return null; } goto z1aov; ODsq1: $FHwN6 = $z8JHA[2]; goto tWm9H; pw7Rl: if ($w4EDX != $mKyzr) { return null; } goto Cp3Hz; z1aov: $Lj2sx = $z8JHA[0]; goto XG2nd; Z8p0Q: return hex2bin($Lj2sx); goto OQJgI; Cp3Hz: $f2fpJ = hexdec($ulOzB); goto obXfa; OQJgI: } public static function md5WithSalt($Oedtb, $l0zWQ) { return md5(md5($Oedtb) . md5($l0zWQ)); } public static function detectCharset($Afv_G, $SLkc7 = array('gbk', 'utf-8')) { $uP0Gz = strtolower(mb_detect_encoding($Afv_G, $SLkc7)); switch ($uP0Gz) { case 'cp936': return 'gbk'; case 'utf-8': return 'utf-8'; default: return $uP0Gz; } } public static function toUTF8($Afv_G, $VLDJO = array('gbk', 'utf-8')) { $uP0Gz = mb_detect_encoding($Afv_G, $VLDJO); return iconv($uP0Gz, 'UTF-8', $Afv_G); } }