hmac - PHP Online

Form of PHP Sandbox

Enter Your PHP code here for testing/debugging in the Online PHP Sandbox. As in the usual PHP files, you can also add HTML, but do not forget to add the tag <?php in the places where the PHP script should be executed.



Your result can be seen below.

Result of php executing





Full code of hmac.php

  1. <?php
  2. $accountID = "9999999";
  3. $key = "11119ca726bf5b0052cc50452e7602ac318d0544836fce6d00add1a8a420766c"; 
  4.  
  5. $uri = "https://ssl2.inventilla.com/v2/events/";
  6.  
  7. $uriPath = parse_url($uri)["path"];
  8.  
  9. $method = "GET";
  10. $date = "Mon, 28 Jun 2021 12:37:13 GMT";
  11.  
  12. $contentMD5 = "";
  13. $contentType = "";
  14.  
  15. $dataString = $method . "\n" . $contentMD5 . "\n" . $contentType . "\n" . $date . "\n" . "\n" . $uriPath;
  16.  
  17. $sha1 = hash_hmac('sha1', $dataString, $key, true);
  18. $base64 = base64_encode($sha1);
  19.  
  20. echo $base64;
  21. ?>
  22.  
File Description
  • hmac
  • PHP Code
  • 28 Jun-2021
  • 500 Bytes
You can Share it: