Skip to content

Instantly share code, notes, and snippets.

@gmanual
Created May 28, 2019 03:57
Show Gist options
  • Save gmanual/b9051d622865b0bab13d4c2b75004759 to your computer and use it in GitHub Desktop.
Save gmanual/b9051d622865b0bab13d4c2b75004759 to your computer and use it in GitHub Desktop.
<?php
$jsonPayload = '{}';
$signing_key = '6e6aa83e-e262-4c0a-8497-46acea553989';
$hmac = base64_encode(hash_hmac("sha256", $jsonPayload, hash('sha256', $signing_key, true) ,true));
echo PHP_EOL;
echo "Json Payload:" . PHP_EOL . $jsonPayload . PHP_EOL;
echo PHP_EOL;
echo "Sign Key : " . $signing_key . PHP_EOL;
echo "Generated: " . $hmac . PHP_EOL;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment