let a1 = require("crypto-js"); let a2 = require("crypto"); //字符串md5加密 let res1 = a1.MD5("123456").toString(); let res2 = a2.createHash("md5").update('123456').digest('hex'); //使用res1或res2都可以,加密结果一样 console.log(res1); console.log(res2);