ionic2项目中实现md5加密

1. 安装插件

npm i ts-md5 --save

2. 在项目中引用

import { Md5 } from 'ts-md5/dist/md5';
...

ionViewDidLoad() {
  let md= Md5.hashStr("test");  
  console.log(md);
}

具体项目中的使用可结合这篇文章。详细api参考官方文档

posted @ 2018-06-05 14:55  吉喆吉  阅读(338)  评论(0编辑  收藏  举报