Convert string to SHA1 hash inside function

Query for NA bot
We are calling an API in which we have to pass the authorisation as SHA1 hash. We want to convert string into SHA1 inside the function. Do we have any functionality for it?

CC - @Kaushik_Natarajan @supersourcin-shikhar @Nisarg_Patel

Hey @Kshitiz_Gupta
You can try the below snippet

const crypto = ymLib.crypto
crypto.createHmac('sha1', Seckey)
            .update(requestdata, 'utf8')
            .digest('base64');

Yes please, I’ll try