Tchat/controllers/securepw.js

8 lines
222 B
JavaScript

//https://lollyrock.com/articles/nodejs-encryption/
var crypto = require('crypto'),
algorithm = 'sha-256';
module.exports = function(text){
return crypto.createHash('sha256').update(text).digest('base64');
}