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);
时间: 2024-12-16 11:27:07