signature.php 422 B

12345678910111213141516171819202122
  1. <?php
  2. Log::record("This is signatrue file.");
  3. $signature = $_GET["signature"];
  4. $timestamp = $_GET["timestamp"];
  5. $nonce = $_GET["nonce"];
  6. $echostr = $_GET["echostr"];
  7. echo("{$echostr}");
  8. $token = 'stanleykinghelloworld';
  9. $tmpArr = [$token, $timestamp, $nonce];
  10. sort($tmpArr, SORT_STRING);
  11. $tmpStr = implode( $tmpArr );
  12. $tmpStr = sha1( $tmpStr );
  13. if( $tmpStr == $signature ){
  14. return true;
  15. }else{
  16. return false;
  17. }