'What is the JavaScript/node.js function HMACSHA256()?
I am trying to find information about this JavaScript/node.js function:
HMACSHA256()
Its mentioned e.g. here:
https://jwt.io/introduction (scroll to section "Signature")
https://hirosht.medium.com/customized-jwt-encoded-with-hmac-sha256-hs256-267574bd7639 (scroll to section "Signature;")
It's mentioned in other places too.
Neither node.js nor any browser JavaScript provides any function with that name.
So what is it? Is it pseudo code or is it a dummy function or simply a mistake everybody copies and pastes?
Solution 1:[1]
You need a plugin named "crypto" It has "createHmac" function where you can give "sha256" as an argument.
https://nodejs.org/api/crypto.html#cryptocreatehmacalgorithm-key-options
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | aymcg31 |
