import crypto from 'crypto'
export default {
  name: 'HelloWorld',
  data () {
    return {
      msg: 'Welcome to Your Vue.js App'
    }
  },
  mounted(){
  	this.getmd5("aaa");
  },
  methods:{
  	getmd5(str){
            var a;
            var md5 = crypto.createHash("md5");
            //update("中文", "utf8")
            md5.update(str);
            var a = md5.digest('hex');
            console.log(a);
            //47bce5c74f589f4867dbd57e9ca9f808
            return a;
        }
  }
}

  

相关文章:

  • 2022-12-23
  • 2021-12-31
  • 2021-10-01
  • 2021-10-17
  • 2022-01-31
  • 2022-02-18
  • 2021-08-21
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-29
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案