<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; class SignUtil { public static function check($fryoH, $psLH5, $AWHVq) { goto KrzDO; KwyIw: if ($fryoH == self::common($psLH5, $AWHVq, 'urlencode')) { return true; } goto fSs1R; KrzDO: if ($fryoH == self::common($psLH5, $AWHVq)) { return true; } goto KwyIw; fSs1R: if ($fryoH == self::common($psLH5, $AWHVq, 'rawurlencode')) { return true; } goto Dk2uo; Dk2uo: return false; goto PUmEh; PUmEh: } public static function common($psLH5, $AWHVq, $XAuan = 'trim', $A9Jz3 = 'app_secret') { goto Zi4R8; d01Sm: $kWMSY[] = $A9Jz3 . '=' . $AWHVq; goto D_X_u; D_X_u: $kWMSY = join('&', $kWMSY); goto v_OAm; qvX8d: foreach ($psLH5 as $kh68j => $tHq0l) { $kWMSY[] = $kh68j . '=' . $XAuan($tHq0l); } goto d01Sm; Zi4R8: ksort($psLH5, SORT_STRING); goto Xf4MU; SyPcU: return $fryoH; goto efzpy; v_OAm: $fryoH = md5($kWMSY); goto SyPcU; Xf4MU: $kWMSY = array(); goto qvX8d; efzpy: } public static function checkWithoutSecret($fryoH, $psLH5, $b2156 = null) { goto aVkJW; qw_pt: return false; goto LaorA; aVkJW: if ($fryoH == self::commonWithoutSecret($psLH5, $b2156)) { return true; } goto wzoeC; wzoeC: if ($fryoH == self::commonWithoutSecret($psLH5, $b2156, 'rawurlencode')) { return true; } goto qw_pt; LaorA: } public static function commonWithoutSecret($psLH5, $b2156 = null, $XAuan = 'urlencode') { goto GSj9o; GC1I3: foreach ($psLH5 as $kh68j => $tHq0l) { $kWMSY[] = $kh68j . '=' . $XAuan($tHq0l); } goto Gin7v; Pd6CD: $kWMSY = array(); goto GC1I3; GSj9o: ksort($psLH5, SORT_STRING); goto Pd6CD; KH2V0: if ($b2156) { $kWMSY = $b2156 . '&' . $kWMSY; } goto FrQJy; Gin7v: $kWMSY = join('&', $kWMSY); goto KH2V0; FrQJy: $fryoH = md5($kWMSY); goto tW8sc; tW8sc: return $fryoH; goto IlebM; IlebM: } }