Comparing version 2.0.0 to 2.0.2
{ | ||
"name": "scrypt", | ||
"description": "The scrypt crypto library for NodeJS", | ||
"version": "2.0.0", | ||
"version": "2.0.2", | ||
"keywords": [ | ||
@@ -6,0 +6,0 @@ "scrypt", |
@@ -219,7 +219,7 @@ #Scrypt For NodeJS | ||
###KDF | ||
`kdf(key, scrypt_parameters, size, salt, callback_function)` | ||
`kdf(key, scrypt_parameters, outputLength, salt, callback_function)` | ||
* `key` - [REQUIRED] - an [encoded string or buffer](#encodings) representing the key to be hashed | ||
* `scrypt_parameters` - [REQUIRED] - a JSON object representing the [scrypt's internal parameters](#params) | ||
* `size` - [OPTIONAL] - an integer, representing the size in bytes of the output | ||
* `outputLength` - [OPTIONAL] - an integer, representing the size in bytes of the output | ||
* `salt` - [OPTIONAL] - an [encoded string or buffer](#encodings) representing the value used for salt. If not defined, a randome salt will be created. | ||
@@ -241,3 +241,3 @@ * `callback_function` - [OPTIONAL] - if present, will make this function asynchronous | ||
defaultSaltSize: 32, | ||
outputSize: 64 | ||
outputLength: 64 | ||
} | ||
@@ -249,3 +249,3 @@ | ||
* `defaultSaltSize` - an integer representing the number of bytes used to create a random salt should it be necessary | ||
* `outputSize` - an integer representing the size of the output in bytes | ||
* `outputLength` - an integer representing the size of the output in bytes | ||
@@ -252,0 +252,0 @@ |
@@ -877,3 +877,3 @@ var test = require('tap').test; | ||
test("Scrypt KDF: Incorrect arguments - size is not a number", function(t) { | ||
test("Scrypt KDF: Incorrect arguments - outputLength is not a number", function(t) { | ||
var kdf = new scrypt.KDF(); | ||
@@ -885,3 +885,3 @@ kdf.config.keyEncoding = "ascii"; | ||
t.ok(err, "Synchronous test - An error was correctly thrown because the size parameter was of type string"); | ||
t.deepEqual(err,scrypt.errorObject(ADDONARG,"size must be a number"), "The correct object is returned, namely: " + JSON.stringify(err)); | ||
t.deepEqual(err,scrypt.errorObject(ADDONARG,"outputLength must be a number"), "The correct object is returned, namely: " + JSON.stringify(err)); | ||
} | ||
@@ -893,3 +893,3 @@ | ||
t.ok(err, "Asynchronous test - An error was correctly thrown because the size parameter was of type string"); | ||
t.deepEqual(err,scrypt.errorObject(ADDONARG,"size must be a number"), "The correct object is returned, namely: " + JSON.stringify(err)); | ||
t.deepEqual(err,scrypt.errorObject(ADDONARG,"outputLength must be a number"), "The correct object is returned, namely: " + JSON.stringify(err)); | ||
t.end(); | ||
@@ -936,1 +936,20 @@ } | ||
}); | ||
test("Scrypt KDF: Incorrect arguments - outputLength is less than or equal to zero", function(t) { | ||
try { | ||
var kdf = new scrypt.KDF(); | ||
kdf.config.keyEncoding = "ascii"; | ||
kdf("key", scryptParameters, 0, ""); | ||
} catch (err) { | ||
t.ok(err, "Synchronous test - An error was correctly thrown because the outputLength was set to zero"); | ||
t.deepEqual(err,scrypt.errorObject(ADDONARG,"outputLength must be greater than 0"), "The correct object is returned, namely: " + JSON.stringify(err)); | ||
} | ||
try { | ||
kdf("key", scryptParameters, 0, "", function(err, result){}); | ||
} catch (err) { | ||
t.ok(err, "Asynchronous test - An error was correctly thrown because the outputLength was set to zero"); | ||
t.deepEqual(err,scrypt.errorObject(ADDONARG,"outputLength must be greater than 0"), "The correct object is returned, namely: " + JSON.stringify(err)); | ||
t.end(); | ||
} | ||
}); |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
541628
60
940
1