How to simplely convert a string to SHA256 string in Node.js. And convert a SHA256 string to a normal string?
const shajs = require('sha.js');
console.log('starts');
const code = 'WEASDSAEWEWAEAWEAWEWA';
const normal = 'anne';
const encrypted = shajs('sha256')
.update(normal)
.digest('hex');
const unencrypted = shajs('sha256')
.read(normal)
.toString('hex');
console.log(normal);
console.log(encrypted);
console.log(unencrypted);
console.log('end');
Where should i put the HASH CODE?