Answers for "how to use crypto module in nodejs"

9

crypto node

const crypto = require('crypto');

const secret = 'abcdefg';
const hash = crypto.createHmac('sha256', secret)
                   .update('I love cupcakes')
                   .digest('hex');
console.log(hash);
// Prints:
//   c0fa1bc00531bd78ef38c628449c5102aeabd49b5dc3a2a516ea6ea959d6658e
Posted by: Guest on May-04-2020
0

how to use crypto module in nodejs

require("crypto").createHmac("sha256", "password")
  .update("If you love node so much why don't you marry it?")
  .digest("hex");
Posted by: Guest on September-30-2021

Code answers related to "how to use crypto module in nodejs"

Code answers related to "Javascript"

Browse Popular Code Answers by Language