Hash text in Node.js


Posted on Aug 02, 2020


featured image
      
const crypto = require('crypto');
const stringToHash = 'hello';
const hash = crypto.createHash('sha256').update(stringToHash).digest('hex');
// the output will be something like: 20ccfac05d596dfb08509494fc7753780ac6d79a23c88ef02514f4c5b2a3ff45

// instead of .digest('hex'); you can use also .digest('base64');
      
    
Photo by Rick Mason on Unsplash

nodejs dev crypto hash javascript
Search
Side Widget
You can put anything you want inside of these side widgets. They are easy to use, and feature the new Bootstrap 4 card containers!