Vue使用md5实现密码加密

使用npm安装: npm install crypto --save

在需要使用的文件中引用crypto  import crypto from 'crypto'

使用方法:

var  md5 = crypto.createHash("md5");
    md5.update(this.password) //需要加密的密码
    var password = md5.digest('hex');  //password 加密完的密码

 

posted @ 2020-06-12 11:00  Judicious  阅读(1953)  评论(0编辑  收藏  举报