@libp2p/peer-id
Advanced tools
Comparing version
@@ -16,3 +16,3 @@ /** | ||
*/ | ||
import { type CID, type MultibaseDecoder } from 'multiformats/cid'; | ||
import { CID, type MultibaseDecoder } from 'multiformats/cid'; | ||
import type { Ed25519PeerId, RSAPeerId, URLPeerId, Secp256k1PeerId, PeerId, PublicKey, Ed25519PublicKey, Secp256k1PublicKey, RSAPublicKey, Ed25519PrivateKey, Secp256k1PrivateKey, RSAPrivateKey, PrivateKey } from '@libp2p/interface'; | ||
@@ -19,0 +19,0 @@ import type { MultihashDigest } from 'multiformats/hashes/interface'; |
@@ -19,3 +19,3 @@ /** | ||
import { base58btc } from 'multiformats/bases/base58'; | ||
import {} from 'multiformats/cid'; | ||
import { CID } from 'multiformats/cid'; | ||
import * as Digest from 'multiformats/hashes/digest'; | ||
@@ -36,2 +36,6 @@ import { identity } from 'multiformats/hashes/identity'; | ||
} | ||
else if (str.startsWith('k51qzi5uqu5') || str.startsWith('kzwfwjn5ji4') || str.startsWith('k2k4r8') || str.startsWith('bafz')) { | ||
// base36 encoded CIDv1 with libp2p-key and identity hash (for ed25519/secp256k1/rsa) or base32 encoded CIDv1 with libp2p-key and identity hash (for ed25519/secp256k1/rsa) | ||
return peerIdFromCID(CID.parse(str)); | ||
} | ||
else { | ||
@@ -38,0 +42,0 @@ if (decoder == null) { |
{ | ||
"name": "@libp2p/peer-id", | ||
"version": "5.0.15", | ||
"version": "5.0.16-0699fb747", | ||
"description": "Implementation of @libp2p/interface-peer-id", | ||
@@ -57,4 +57,4 @@ "license": "Apache-2.0 OR MIT", | ||
"dependencies": { | ||
"@libp2p/crypto": "^5.0.14", | ||
"@libp2p/interface": "^2.6.1", | ||
"@libp2p/crypto": "5.0.15-0699fb747", | ||
"@libp2p/interface": "2.7.0-0699fb747", | ||
"multiformats": "^13.3.1", | ||
@@ -61,0 +61,0 @@ "uint8arrays": "^5.1.0" |
@@ -20,3 +20,3 @@ /** | ||
import { base58btc } from 'multiformats/bases/base58' | ||
import { type CID, type MultibaseDecoder } from 'multiformats/cid' | ||
import { CID, type MultibaseDecoder } from 'multiformats/cid' | ||
import * as Digest from 'multiformats/hashes/digest' | ||
@@ -41,2 +41,5 @@ import { identity } from 'multiformats/hashes/identity' | ||
multihash = Digest.decode(base58btc.decode(`z${str}`)) | ||
} else if (str.startsWith('k51qzi5uqu5') || str.startsWith('kzwfwjn5ji4') || str.startsWith('k2k4r8') || str.startsWith('bafz')) { | ||
// base36 encoded CIDv1 with libp2p-key and identity hash (for ed25519/secp256k1/rsa) or base32 encoded CIDv1 with libp2p-key and identity hash (for ed25519/secp256k1/rsa) | ||
return peerIdFromCID(CID.parse(str)) | ||
} else { | ||
@@ -43,0 +46,0 @@ if (decoder == null) { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
122691
-0.01%13
-7.14%1005
-0.3%1
Infinity%+ Added
+ Added
- Removed
- Removed