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.
Result of php executing
Full code of hmac.php
- <?php
- $accountID = "9999999";
- $key = "11119ca726bf5b0052cc50452e7602ac318d0544836fce6d00add1a8a420766c";
- $uri = "https://ssl2.inventilla.com/v2/events/";
- $uriPath = parse_url($uri)["path"];
- $method = "GET";
- $date = "Mon, 28 Jun 2021 12:37:13 GMT";
- $contentMD5 = "";
- $contentType = "";
- $dataString = $method . "\n" . $contentMD5 . "\n" . $contentType . "\n" . $date . "\n" . "\n" . $uriPath;
- $sha1 = hash_hmac('sha1', $dataString, $key, true);
- $base64 = base64_encode($sha1);
- echo $base64;
- ?>