Converting PHP hash to CF
Hello. I'm hoping someone can help me convert some PHP hash code to CF (2018). I'm confused by PHPs hash_init, hash_hmac, hash_update and hash_final.
// PHP
$sha256_hash = hash_init("sha256",HASH_HMAC,$secret);
hash_update($sha256_hash,$hash_string);
$signature = hash_final($sha256_hash);I'm having a hard time wrapping my head around the three steps being done here and what the HASH_HMAC contstant is in PHP (yes, I've Googled...).
I've taken a few stabs at it in CF with HASH and HMAC but am coming up empty.
<CFSET signature = lcase(hmac(hash_string, secret, "HMACSHA256")) >Any thoughts?
Thanks,
John.
