Comparing version 0.6.0 to 0.6.1
{ | ||
"name": "peer-id", | ||
"version": "0.6.0", | ||
"version": "0.6.1", | ||
"description": "IPFS Peer Id implementation in Node.js", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -100,5 +100,11 @@ /* | ||
// generation | ||
exports.create = function () { | ||
exports.create = function (opts) { | ||
opts = opts || {} | ||
opts.bits = opts.bits || 2048 | ||
// generate keys | ||
const pair = forge.rsa.generateKeyPair({ bits: 2048, e: 0x10001 }) | ||
const pair = forge.rsa.generateKeyPair({ | ||
bits: opts.bits, | ||
e: 0x10001 | ||
}) | ||
@@ -105,0 +111,0 @@ // return the RSA public/private key to asn1 object |
@@ -65,3 +65,10 @@ /* globals describe, it */ | ||
}) | ||
it('Non-default # of bits', (done) => { | ||
const shortId = PeerId.create({ bits: 128 }) | ||
const longId = PeerId.create({ bits: 256 }) | ||
expect(shortId.privKey.length).is.below(longId.privKey.length) | ||
done() | ||
}) | ||
}) | ||
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
3046159
93640