Help with encryption functions

Help with encryption functions

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?
    Zoho Desk Resources

    • Desk Community Learning Series


    • Digest


    • Functions


    • Meetups


    • Kbase


    • Resources


    • Glossary


    • Desk Marketplace


    • MVP Corner


    • Word of the Day


      Zoho CRM Plus Resources

        Zoho Books Resources


          Zoho Subscriptions Resources

            Zoho Projects Resources


              Zoho Sprints Resources


                Zoho Orchestly Resources


                  Zoho Creator Resources


                    Zoho WorkDrive Resources



                      Zoho Campaigns Resources

                        Zoho CRM Resources

                        • CRM Community Learning Series

                          CRM Community Learning Series


                        • Tips

                          Tips

                        • Functions

                          Functions

                        • Meetups

                          Meetups

                        • Kbase

                          Kbase

                        • Resources

                          Resources

                        • Digest

                          Digest

                        • CRM Marketplace

                          CRM Marketplace

                        • MVP Corner

                          MVP Corner




                          Zoho Writer Writer

                          Get Started. Write Away!

                          Writer is a powerful online word processor, designed for collaborative work.

                            Zoho CRM コンテンツ




                              ご検討中の方