Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!--<?php
- /*
- date_default_timezone_set('UTC');
- $tStamp = strval(time()-strtotime('1970-01-01 00:00:00'));
- $cons_id = "XXXXXX";
- $data= $cons_id."&".$tStamp;
- echo $data;
- $secretKey = "XXXXX";
- echo $tStamp;
- // Computes the signature by hashing the salt with the secret key as the key
- $signature = hash_hmac('sha256', $data, $secretKey, true);
- // base64 encode…
- $encodedSignature = base64_encode($signature);
- # echo $encodedSignature;
- // urlencode…
- // $encodedSignature = urlencode($encodedSignature);
- */
- ?>-->
- <?php
- $data = "XXXX";
- $secretKey = "XXXXX";
- // Computes the timestamp
- //date_default_timezone_set('UTC');
- //$tStamp = strval(time()-strtotime('1970-01-01 00:00:00'));
- date_default_timezone_set('UTC');
- $tStamp = strval(time()-strtotime('1970-01-01 00:00:00'));
- $signature = hash_hmac('sha256', $data."&".$tStamp, $secretKey, true);
- $encodedSignature = base64_encode($signature);
- // Computes the signature by hashing the salt with the secret key as the key
- $signature = hash_hmac('sha256', $data."&".$tStamp, $secretKey, true);
- // base64 encode…
- $encodedSignature = base64_encode($signature);
- // urlencode…
- // $encodedSignature = urlencode($encodedSignature);
- //echo "X-cons-id: " .$data ." ";
- //echo "X-timestamp:" .$tStamp ." ";
- //echo "X-signature: " .$encodedSignature;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement