how to generate md5 hash in angular 2 typescript?

前端 未结 2 486
臣服心动
臣服心动 2020-12-30 02:03

I am using APi The access to this api is done with hash key that we need to send to the api but we don\'t really know how to implement.

I found https://www.npmjs.co

2条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-30 02:25

    You can get a md5.ts file here:

    https://github.com/ManvendraSK/angular2-quickstart/blob/master/app/md5.ts

    import it in your component/service:

    import {md5} from './md5'; //make sure it points to the folder where the md5.ts file is
    

    then you can use it in your component/service:

    let e = md5(this.email);
    

提交回复
热议问题