<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; class SignUtil { public static function check($AYE7s, $CCHgz, $RUHnb) { goto cwV4k; jhLjN: return false; goto AdOkm; cwV4k: if ($AYE7s == self::common($CCHgz, $RUHnb)) { return true; } goto zjjAq; iAZph: if ($AYE7s == self::common($CCHgz, $RUHnb, 'rawurlencode')) { return true; } goto jhLjN; zjjAq: if ($AYE7s == self::common($CCHgz, $RUHnb, 'urlencode')) { return true; } goto iAZph; AdOkm: } public static function common($CCHgz, $RUHnb, $oOjVE = 'trim', $k23nx = 'app_secret') { goto wFJQN; cTa_8: foreach ($CCHgz as $GBNIv => $VFelt) { $M37j0[] = $GBNIv . '=' . $oOjVE($VFelt); } goto MGekQ; PzTEx: $AYE7s = md5($M37j0); goto Thpl_; wFJQN: ksort($CCHgz, SORT_STRING); goto UDjN2; Thpl_: return $AYE7s; goto d2773; gCLc0: $M37j0 = join('&', $M37j0); goto PzTEx; MGekQ: $M37j0[] = $k23nx . '=' . $RUHnb; goto gCLc0; UDjN2: $M37j0 = array(); goto cTa_8; d2773: } public static function checkWithoutSecret($AYE7s, $CCHgz, $cxyYM = null) { goto mSQ9j; mSQ9j: if ($AYE7s == self::commonWithoutSecret($CCHgz, $cxyYM)) { return true; } goto WycJt; aPuVe: return false; goto N3muM; WycJt: if ($AYE7s == self::commonWithoutSecret($CCHgz, $cxyYM, 'rawurlencode')) { return true; } goto aPuVe; N3muM: } public static function commonWithoutSecret($CCHgz, $cxyYM = null, $oOjVE = 'urlencode') { goto UjcIq; vlQI0: $AYE7s = md5($M37j0); goto vzlDK; aKtfa: $M37j0 = join('&', $M37j0); goto faIVh; faIVh: if ($cxyYM) { $M37j0 = $cxyYM . '&' . $M37j0; } goto vlQI0; InnHu: $M37j0 = array(); goto kjGeC; kjGeC: foreach ($CCHgz as $GBNIv => $VFelt) { $M37j0[] = $GBNIv . '=' . $oOjVE($VFelt); } goto aKtfa; vzlDK: return $AYE7s; goto x9iJ5; UjcIq: ksort($CCHgz, SORT_STRING); goto InnHu; x9iJ5: } }