夺命雷公狗---node.js---15之加密

node其实也给我们留下了密码的加密发送,不过一般都是用cmd5加密其实也是够了,但是sha1加密也要提下:

/**
 * Created by leigood on 2016/8/31.
 */
var crypto = require('crypto');
var md5 =  crypto.createHash('md5');
var pass = 'admin888';
md5.update(pass);
//var ps = md5.digest('md5');
//console.log(ps);


var ps2 = md5.digest('sha1');
console.log(ps2);
原文地址:https://www.cnblogs.com/leigood/p/5824381.html