Comparing version 0.3.2 to 0.4.0
@@ -10,2 +10,3 @@ var bcrypt = require('../bcrypt'); | ||
console.log('crypted cb end: ' + (Date.now() - start) + 'ms'); | ||
console.log('rounds used from hash:', bcrypt.get_rounds(crypted)); | ||
bcrypt.compare('test', crypted, function(err, res) { | ||
@@ -12,0 +13,0 @@ console.log('compared true: ' + res); |
@@ -6,3 +6,3 @@ { | ||
"main": "./bcrypt", | ||
"version": "0.3.2", | ||
"version": "0.4.0", | ||
"author": "Nick Campbell (http://github.com/ncb000gt)", | ||
@@ -9,0 +9,0 @@ "engines": { "node": ">= 0.4.0" }, |
@@ -110,3 +110,6 @@ node.bcrypt.js | ||
* `same` - Second parameter to the callback providing whether the data and encrypted forms match [true | false]. | ||
* `get_rounds(encrypted)` - return the number of rounds used to encrypt a given hash | ||
* `encrypted` - [REQUIRED] - hash from which the number of rounds used should be extracted. | ||
Hash Info | ||
@@ -113,0 +116,0 @@ ============ |
@@ -11,3 +11,3 @@ var testCase = require('nodeunit').testCase, | ||
test_salt_no_params: function(assert) { | ||
assert.throws(function() {bcrypt.gen_salt_sync();}, "Should throw an Error. gen_salt requires # of rounds."); | ||
assert.throws(function() {bcrypt.gen_salt_sync();}, "Should not throw an Error. ."); | ||
assert.done(); | ||
@@ -75,3 +75,8 @@ }, | ||
assert.done(); | ||
}, | ||
test_get_rounds: function(assert) { | ||
var hash = bcrypt.encrypt_sync("test", bcrypt.gen_salt_sync(9)); | ||
assert.equals(9, bcrypt.get_rounds(hash), "get_rounds can't extract rounds"); | ||
assert.done(); | ||
} | ||
}); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
74814
312
175