<? php//將timestamp,nonce,token按字典序排序 $timestamp ?= $_GET['timestamp']; $nonce ? ?= $_GET['nonce']; $token ? ?= 'TOKEN'; $signature = $_GET['signature']; $echostr = $_GET['echostr'] $arr = array($timestamp,$nonce,$token); sort($arr,SORT_STRING); //將排序后的數(shù)組拼接成字符串 $tmpstr =implode($arr); $tmpstr =sha1($tmpstr); //將加密后的字符串進(jìn)行對比 if($tmpstr == $signature) { echo $echostr; exit; }
- 1 回答
- 0 關(guān)注
- 1027 瀏覽