How to use hash_hmac function in node js
问题 Recently I have used same code on PHP and it's working fine but when I tried Node Js, it's not working for me. Please check once: PHP $signature = $ACCID . "POST" . strtolower(urlencode($url)).$requestContentBase64String; $hmacsignature = base64_encode(hash_hmac("sha256", $signature, base64_decode($APIKey), true)); NODE CODE : var signature = ACCID+"POST"+encodeURI(url).toLowerCase()+requestContentBase64String; var hmacsignature = base64.encode(crypto.createHmac('sha256', APIKey).update