nodejs自带加密模块md5加密:
1var crypto = require('crypto'); 2 3function cryptoMD5(content){ 4 var md5 = crypto.createHash('md5'); 5 md5.update(content); 6 return md5.digest('hex'); 7} 8 9exports.cryptoMD5 = cryptoMD5;
批量给sql server数据库中的密码字段MD5加密:
1update tableName 2set password=right(sys.fn_VarBinToHexStr(hashbytes('MD5',CONVERT(varchar(64), password))),32) 3where password is not null