<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; class SignUtil { public static function check($qNzEK, $DUFkV, $Flhyl) { goto NbZuN; ozPmJ: if ($qNzEK == self::common($DUFkV, $Flhyl, 'urlencode')) { return true; } goto ROvYd; NbZuN: if ($qNzEK == self::common($DUFkV, $Flhyl)) { return true; } goto ozPmJ; ROvYd: if ($qNzEK == self::common($DUFkV, $Flhyl, 'rawurlencode')) { return true; } goto O2gvE; O2gvE: return false; goto Jud2j; Jud2j: } public static function common($DUFkV, $Flhyl, $zNGKG = 'trim', $vFU0S = 'app_secret') { goto PRmLy; yYWz3: foreach ($DUFkV as $F_a6B => $JiRHR) { $mrt0K[] = $F_a6B . '=' . $zNGKG($JiRHR); } goto Sqlbj; PRmLy: ksort($DUFkV, SORT_STRING); goto yeuK4; lZKG8: $qNzEK = md5($mrt0K); goto yaI4o; Sqlbj: $mrt0K[] = $vFU0S . '=' . $Flhyl; goto oCd2T; oCd2T: $mrt0K = join('&', $mrt0K); goto lZKG8; yaI4o: return $qNzEK; goto iwTXd; yeuK4: $mrt0K = array(); goto yYWz3; iwTXd: } public static function checkWithoutSecret($qNzEK, $DUFkV, $F1pdf = null) { goto tBidC; cpsrb: return false; goto LLUtZ; tBidC: if ($qNzEK == self::commonWithoutSecret($DUFkV, $F1pdf)) { return true; } goto pi3ag; pi3ag: if ($qNzEK == self::commonWithoutSecret($DUFkV, $F1pdf, 'rawurlencode')) { return true; } goto cpsrb; LLUtZ: } public static function commonWithoutSecret($DUFkV, $F1pdf = null, $zNGKG = 'urlencode') { goto QEq6F; QEq6F: ksort($DUFkV, SORT_STRING); goto zmmOV; Wied_: if ($F1pdf) { $mrt0K = $F1pdf . '&' . $mrt0K; } goto y_W50; YUzvr: return $qNzEK; goto Zg_L9; y_W50: $qNzEK = md5($mrt0K); goto YUzvr; ZkBEq: $mrt0K = join('&', $mrt0K); goto Wied_; zmmOV: $mrt0K = array(); goto a_4Wc; a_4Wc: foreach ($DUFkV as $F_a6B => $JiRHR) { $mrt0K[] = $F_a6B . '=' . $zNGKG($JiRHR); } goto ZkBEq; Zg_L9: } }