signature.php 336 B

1234567891011121314151617
  1. <?php
  2. $signature = $_GET["signature"];
  3. $timestamp = $_GET["timestamp"];
  4. $nonce = $_GET["nonce"];
  5. $token = 'stanleykinghelloworld';
  6. $tmpArr = array($token, $timestamp, $nonce);
  7. sort($tmpArr, SORT_STRING);
  8. $tmpStr = implode( $tmpArr );
  9. $tmpStr = sha1( $tmpStr );
  10. if( $tmpStr == $signature ){
  11. return true;
  12. }else{
  13. return false;
  14. }