Skip to content

Commit a553227

Browse files
committed
Use 'rounds' in genSalt, fixes #9
1 parent 565bee8 commit a553227

4 files changed

Lines changed: 18 additions & 20 deletions

File tree

dist/bcrypt.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -993,10 +993,9 @@
993993
callback = seed_length;
994994
seed_length = undefined; // Not supported.
995995
}
996-
var rnd; // Hello closure
997996
if (typeof rounds === 'function') {
998997
callback = rounds;
999-
rnd = GENSALT_DEFAULT_LOG2_ROUNDS;
998+
rounds = GENSALT_DEFAULT_LOG2_ROUNDS;
1000999
}
10011000
if (typeof callback !== 'function')
10021001
throw(new Error("Illegal callback: "+callback));
@@ -1006,7 +1005,7 @@
10061005
}
10071006
_nextTick(function() { // Pretty thin, but salting is fast enough
10081007
try {
1009-
callback(null, bcrypt.genSaltSync(rnd));
1008+
callback(null, bcrypt.genSaltSync(rounds));
10101009
} catch(err) {
10111010
callback(err);
10121011
}

dist/bcrypt.min.js

Lines changed: 13 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "bcryptjs",
33
"description": "Optimized bcrypt in plain JavaScript with zero dependencies. Compatible to 'bcrypt'.",
4-
"version": "1.0.4",
4+
"version": "1.0.5",
55
"author": "Daniel Wirtz <dcode@dcode.io>",
66
"contributors": [
77
"Shane Girish <shaneGirish@gmail.com> (https://github.com/shaneGirish)",

src/bcrypt.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -746,10 +746,9 @@
746746
callback = seed_length;
747747
seed_length = undefined; // Not supported.
748748
}
749-
var rnd; // Hello closure
750749
if (typeof rounds === 'function') {
751750
callback = rounds;
752-
rnd = GENSALT_DEFAULT_LOG2_ROUNDS;
751+
rounds = GENSALT_DEFAULT_LOG2_ROUNDS;
753752
}
754753
if (typeof callback !== 'function')
755754
throw(new Error("Illegal callback: "+callback));
@@ -759,7 +758,7 @@
759758
}
760759
_nextTick(function() { // Pretty thin, but salting is fast enough
761760
try {
762-
callback(null, bcrypt.genSaltSync(rnd));
761+
callback(null, bcrypt.genSaltSync(rounds));
763762
} catch(err) {
764763
callback(err);
765764
}

0 commit comments

Comments
 (0)