Answers for "node crypto hmac sha256"

0

node crypto hmac sha256

//Name of the file : sha256-hmac.js
//Loading the crypto module in node.js
var crypto = require('crypto');
//creating hmac object 
var hmac = crypto.createHmac('sha256', 'yoursecretkeyhere');
//passing the data to be hashed
data = hmac.update('nodejsera');
//Creating the hmac in the required format
gen_hmac= data.digest('hex');
//Printing the output on the console
console.log("hmac : " + gen_hmac);
Posted by: Guest on March-16-2022

Code answers related to "Javascript"

Browse Popular Code Answers by Language