node.js - bcrypt加密密码计算强度代表什么意思
ringa_lee
ringa_lee 2017-04-17 11:53:12
0
1
527

nodejs 中Bcrypt 在计算salt值时,计算强度为什么1-3 是一个阶段,4-10 是另外一个阶段。

var bcrypt = require('bcrypt-nodejs'); for (k=0;k<11;k++){ timeout(k); } function timeout(round){ console.log("round:"+round); var start = new Date(); for(i=0;i<10;i++){ var salt = bcrypt.genSaltSync(round); var hash = bcrypt.hashSync('gebilaowang',salt); // console.log(hash); } var end = new Date(); console.log(end-start+'ms'); }

1-3 的计算时间是1067ms ,和为10的值几本一样,但是4 才50ms,之后每次多一点一直到10,

ringa_lee
ringa_lee

ringa_lee

全員に返信 (1)
阿神

https://github.com/shaneGirish/bcrypt-nodejs/blob/master/bCrypt.js#L54...

小于4轮是不好使的会默认变成10轮

いいねを押す+0
    最新のダウンロード
    詳細>
    ウェブエフェクト
    公式サイト
    サイト素材
    フロントエンドテンプレート
    私たちについて 免責事項 Sitemap
    PHP中国語ウェブサイト:福祉オンライン PHP トレーニング,PHP 学習者の迅速な成長を支援します!