Comparing version 0.1.50 to 0.1.51
{ | ||
"name": "node-rsa", | ||
"version": "0.1.50", | ||
"version": "0.1.51", | ||
"description": "Node.js RSA library", | ||
@@ -5,0 +5,0 @@ "main": "src/NodeRSA.js", |
@@ -107,3 +107,3 @@ # Node-RSA | ||
**buffer** - data for encrypting, may be string, Buffer, or any object/array. Arrays and objects will encoded to JSON string first.<br/> | ||
**encoding** - encoding for output result, may be `'buffer'`, `'binary'`, `'hex'` or 'base64'. Default `'buffer'`.<br/> | ||
**encoding** - encoding for output result, may be `'buffer'`, `'binary'`, `'hex'` or `'base64'`. Default `'buffer'`.<br/> | ||
**source_encoding** - source encoding, works only with string buffer. Can take standard Node.js Buffer encodings (hex, utf8, base64, etc). `'utf8'` by default.<br/> | ||
@@ -110,0 +110,0 @@ |
@@ -48,6 +48,6 @@ /*! | ||
bits = bits || 2048; | ||
exp = 65537; | ||
exp = exp || 65537; | ||
if (bits % 2 == 1) { | ||
throw Error('Key size must be even.'); | ||
if (bits % 8 !== 0) { | ||
throw Error('Key size must be a multiple of 8.'); | ||
} | ||
@@ -54,0 +54,0 @@ |
@@ -63,3 +63,3 @@ /** | ||
(function(size){ | ||
it("should make key pair " + size.b + "-bit length and public exponent is " + (size.e || 65537), function () { | ||
it("should make key pair " + size.b + "-bit length and public exponent is " + (size.e ? size.e : size.e + ' and should be 65537'), function () { | ||
generatedKeys.push(new NodeRSA({b: size.b, e: size.e})); | ||
@@ -69,2 +69,3 @@ assert.instanceOf(generatedKeys[generatedKeys.length - 1].keyPair, Object); | ||
assert.equal(generatedKeys[generatedKeys.length - 1].getMaxMessageSize(), (size.b / 8 - 11)); | ||
assert.equal(generatedKeys[generatedKeys.length - 1].keyPair.e, size.e || 65537); | ||
}); | ||
@@ -71,0 +72,0 @@ })(keySizes[size]); |
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
91090
2408