Created
April 24, 2024 01:50
-
-
Save satyendrakumarsingh/f154cee556b1eb4f3cd440e0f869efc9 to your computer and use it in GitHub Desktop.
php-mac
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function generateHmacSha512($hmacData, $secretKey) { | |
$hmacValue = hash_hmac('sha512', $hmacData, pack('H*', $secretKey) , true); | |
return base64_encode($hmacValue); | |
} | |
# TEST HMACSHA512 FUNCTION | |
$hmacData = "satyendra"; | |
$secretKey = "6B58703273357638792F423F4528472B4B6250655368566D597133743677397A"; | |
echo generateHmacSha512($hmacData, $secretKey); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment