I want to compute the SHA256 based HMAC for some key
and a message
in front-end using JavaScript. It's easily done in Python like so:
import hmac
h = hmac.new(b'key', b'message', 'sha256')
print(h.hexdigest())
I searched and found something in NodeJS but can't do the same thing in front-end (I mean in browser of the user), which I guess I need to bundle the required library and do the stuff but could not figure out how.