PHP base64_encode(hash_hmac()) to ToBase64(Hmac())
Hi there
I am looking for the right ColdFusion functions to compare with PHP functons.
In PHP:
PHP Calculations (these are the correct ones)
$xValue = base64_encode(hash_hmac("sha512", "test", true));
echo $xValue;
Is the result:
ZjNlNzQ4NGE3YmIyMjJmNDU4MzgxOTZhMTQzMDIwYjNmOGNkZDJhMDQzYjZjOWMyNWU4NTBk
MmM5NDk1MGQ5YTRhMzE5OGRmOWFmOWZhMDMxOGNmOGRhMDg2NGVmMzU2NGE2YWU1Mj
A3NTQwN2Q0ZmFmNjFjMjJkOGZiZDM3NGU=
In CF:
<cfset xMacValue = ToBase64(Hmac("test", "HMACSHA512")) />
<cfdump var="#xMacValue#" />is the result:
NkJEQ0NEN0VFNkY1QUYyMTU5NjNENDY0NERBMDQwMjQ=.
Which CF functions do I need to use to get the result from PHP?
Thank you for your support
Steve
