0
ionic2タイスクリプトファイルのパスワードを暗号化する方法です。以下のリンクを参照し、ionic2アプリにpbkdf2モジュールをインポートしました。 enter link description hereは、ionic2のpbkdf2-sha256を使用してパスワードを暗号化します。
しかしwebpack_require .I(...)はfunction.can誰も私はこれを解決する手助け...
import { Component } from '@angular/core';
import { NavController, NavParams } from 'ionic-angular';
import { pbkdf2 } from '../../../node_modules/pbkdf2-sha256/lib/pbkdf2.js';
/*
Generated class for the Firstpage page.
See http://ionicframework.com/docs/v2/components/#navigation for more info on
Ionic pages and navigation.
*/
@Component({
selector: 'page-firstpage',
templateUrl: 'firstpage.html'
})
export class FirstpagePage {
\t key : any = "passwd";
\t salt :any ="salt";
\t res :any ;
constructor(public navCtrl: NavController, public navParams: NavParams) {}
ionViewDidLoad() {
console.log('ionViewDidLoad FirstpagePage');
}
encrypt(){
console.log("-----");
\t this.res = pbkdf2(this.key, this.salt, 1, 64);
\t console.log(this.res.toString('hex'))
}
}