i want to calc a hmac with md5.
crypto-js is not longer maintained. crypto-js - npm
Is it possible to use node:crypto in a function node?
https://nodejs.org/docs/latest-v20.x/api/crypto.html#class-hmac
Am i overthinking or missing something?
const text = 'I love cupcakes'
const key = 'abcdeg'
const gen_hmac = crypto.createHmac('md5', key)
.update(text)
.digest('hex')
msg.payload = gen_hmac
return msg;
[{"id":"9fcd0d88c89ef781","type":"function","z":"02f9e197120dd932","name":"hmac","func":"const text = 'I love cupcakes'\nconst key = 'abcdeg'\n\n\nconst gen_hmac = crypto.createHmac('md5', key)\n .update(text)\n .digest('hex')\nmsg.payload = gen_hmac\nreturn msg;","outputs":1,"timeout":0,"noerr":1,"initialize":"","finalize":"","libs":[],"x":850,"y":260,"wires":[["456c3c15f6eccc6f"]]},{"id":"c91edeaad15ab4ac","type":"inject","z":"02f9e197120dd932","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":680,"y":260,"wires":[["9fcd0d88c89ef781"]]},{"id":"456c3c15f6eccc6f","type":"debug","z":"02f9e197120dd932","name":"debug 448","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1070,"y":260,"wires":[]}]