<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; class SignUtil { public static function check($qwA4o, $Sy_B1, $Mpn9X) { goto XYiuc; XYiuc: if ($qwA4o == self::common($Sy_B1, $Mpn9X)) { return true; } goto F3Y9j; GL23H: return false; goto q2Fup; YDc5r: if ($qwA4o == self::common($Sy_B1, $Mpn9X, 'rawurlencode')) { return true; } goto GL23H; F3Y9j: if ($qwA4o == self::common($Sy_B1, $Mpn9X, 'urlencode')) { return true; } goto YDc5r; q2Fup: } public static function common($Sy_B1, $Mpn9X, $Gb01W = 'trim', $kyfdG = 'app_secret') { goto y5pqA; y5pqA: ksort($Sy_B1, SORT_STRING); goto wMoA4; G7Ucn: $qwA4o = md5($ef7q7); goto LCg2L; ah4GR: foreach ($Sy_B1 as $plrwN => $uTz0e) { $ef7q7[] = $plrwN . '=' . $Gb01W($uTz0e); } goto vcuQe; AiGoY: $ef7q7 = join('&', $ef7q7); goto G7Ucn; LCg2L: return $qwA4o; goto am9Qj; wMoA4: $ef7q7 = array(); goto ah4GR; vcuQe: $ef7q7[] = $kyfdG . '=' . $Mpn9X; goto AiGoY; am9Qj: } public static function checkWithoutSecret($qwA4o, $Sy_B1, $sGiaY = null) { goto fCepC; fCepC: if ($qwA4o == self::commonWithoutSecret($Sy_B1, $sGiaY)) { return true; } goto dNxnw; dNxnw: if ($qwA4o == self::commonWithoutSecret($Sy_B1, $sGiaY, 'rawurlencode')) { return true; } goto fVkxh; fVkxh: return false; goto Jo427; Jo427: } public static function commonWithoutSecret($Sy_B1, $sGiaY = null, $Gb01W = 'urlencode') { goto vs1eT; c3Les: $ef7q7 = array(); goto sGlC1; BSkea: $ef7q7 = join('&', $ef7q7); goto oadY0; sGlC1: foreach ($Sy_B1 as $plrwN => $uTz0e) { $ef7q7[] = $plrwN . '=' . $Gb01W($uTz0e); } goto BSkea; vs1eT: ksort($Sy_B1, SORT_STRING); goto c3Les; i8UOu: $qwA4o = md5($ef7q7); goto Maqj7; Maqj7: return $qwA4o; goto LSz2b; oadY0: if ($sGiaY) { $ef7q7 = $sGiaY . '&' . $ef7q7; } goto i8UOu; LSz2b: } }