@libp2p/peer-id
Advanced tools
Comparing version 1.1.9 to 1.1.10
@@ -24,2 +24,6 @@ import { CID } from 'multiformats/cid'; | ||
/** | ||
* Returns Multiaddr as a JSON encoded object | ||
*/ | ||
toJSON(): string; | ||
/** | ||
* Checks the equality of `this` peer against a given PeerId | ||
@@ -26,0 +30,0 @@ */ |
@@ -51,2 +51,8 @@ import { CID } from 'multiformats/cid'; | ||
/** | ||
* Returns Multiaddr as a JSON encoded object | ||
*/ | ||
toJSON() { | ||
return this.toString(); | ||
} | ||
/** | ||
* Checks the equality of `this` peer against a given PeerId | ||
@@ -153,6 +159,6 @@ */ | ||
else if (multihash.code === identity.code) { | ||
if (multihash.bytes.length === MARSHALLED_ED225519_PUBLIC_KEY_LENGTH) { | ||
if (multihash.digest.length === MARSHALLED_ED225519_PUBLIC_KEY_LENGTH) { | ||
return new Ed25519PeerIdImpl({ multihash: cid.multihash }); | ||
} | ||
else if (multihash.bytes.length === MARSHALLED_SECP258K1_PUBLIC_KEY_LENGTH) { | ||
else if (multihash.digest.length === MARSHALLED_SECP258K1_PUBLIC_KEY_LENGTH) { | ||
return new Secp256k1PeerIdImpl({ multihash: cid.multihash }); | ||
@@ -159,0 +165,0 @@ } |
{ | ||
"name": "@libp2p/peer-id", | ||
"version": "1.1.9", | ||
"version": "1.1.10", | ||
"description": "IPFS Peer Id implementation in Node.js", | ||
@@ -5,0 +5,0 @@ "license": "Apache-2.0 OR MIT", |
@@ -94,2 +94,9 @@ import { CID } from 'multiformats/cid' | ||
/** | ||
* Returns Multiaddr as a JSON encoded object | ||
*/ | ||
toJSON () { | ||
return this.toString() | ||
} | ||
/** | ||
* Checks the equality of `this` peer against a given PeerId | ||
@@ -217,5 +224,5 @@ */ | ||
} else if (multihash.code === identity.code) { | ||
if (multihash.bytes.length === MARSHALLED_ED225519_PUBLIC_KEY_LENGTH) { | ||
if (multihash.digest.length === MARSHALLED_ED225519_PUBLIC_KEY_LENGTH) { | ||
return new Ed25519PeerIdImpl({ multihash: cid.multihash }) | ||
} else if (multihash.bytes.length === MARSHALLED_SECP258K1_PUBLIC_KEY_LENGTH) { | ||
} else if (multihash.digest.length === MARSHALLED_SECP258K1_PUBLIC_KEY_LENGTH) { | ||
return new Secp256k1PeerIdImpl({ multihash: cid.multihash }) | ||
@@ -222,0 +229,0 @@ } |
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
26915
420