I'm trying to replicate this PHP function in Zoho Creator's Deluge:
$digest = base64_encode(hash('sha256', $nonce . $created . $userApiKey,true));
The variables $nonce, $created, and $userApiKey contain strings which should be encrypted with SHA256 in binary format and the this result has to be base64 encoded. This works in PHP but I haven't been able to replicate in Zoho Creator. This is what I came up with so far:
testDigest = zoho.encryption.base64Encode(zoho.encryption.hmacsha256(testNonce + testCreated + testSecret,"binary"));
Here are some test values for the variables if anyone can help me with this
testNonce = "WScqanjCEAC4mQo";
testCreated = "2021-07-05T11:15:07Z";
testSecret = "c8b624cbb438452eaa5fcb190054348d";
The correct result if performed with those values should be "MV169bpzNweFV2R92bCnv1G+SJqyDUHCetAWXsnHdhI=" but I'm getting "S1pwaFhZOVdFaDFGN1FNNUM1c0lUa2FseVppK3Y5a0VyNms3MVpZclo2az0=" What am I doing wrong?