I am trying to Hash a text using HMAC SHA-256 in Javascript I have [secret Ket]
I have Ruby code to hash, but I need Javascript code to Hash the text
Ruby Code
OpenSSL::HMAC.hexdigest(
'sha256', # hash function
'HFgGgIOaLiyFgUhIjirOoqxloHuiLNr20jkhXrNw', # secret key (keep safe!)
current_user.email # user's email address
)
Please suggest me for any solution.