New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@libp2p/peer-id

Package Overview
Dependencies
Maintainers
6
Versions
659
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@libp2p/peer-id - npm Package Compare versions

Comparing version

to
5.0.16-0699fb747

2

dist/src/index.d.ts

@@ -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