Socket
Socket
Sign inDemoInstall

k-bucket

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

k-bucket - npm Package Compare versions

Comparing version 3.2.1 to 3.3.0

6

index.js

@@ -56,2 +56,6 @@ /*

`crypto.randomBytes(20)`.
* `metadata`: _Object_ _(Default: {})_ Optional satellite data to include
with the k-bucket. `metadata` property is guaranteed not be altered by,
it is provided as an explicit container for users of k-bucket to store
implementation-specific data.
* `numberOfNodesPerKBucket`: _Integer_ _(Default: 20)_ The number of nodes

@@ -77,2 +81,4 @@ that a k-bucket can contain before being full or split.

this.root = createNode()
this.metadata = Object.assign({}, options.metadata)
}

@@ -79,0 +85,0 @@

5

package.json
{
"name": "k-bucket",
"version": "3.2.1",
"version": "3.3.0",
"description": "Kademlia DHT K-bucket implementation as a binary tree",

@@ -21,3 +21,4 @@ "keywords": [

"Fabien O'Carroll <fabien@allou.is>",
"Kirill Fomichev <fanatid@ya.ru>"
"Kirill Fomichev <fanatid@ya.ru>",
"Robert Kowalski <rok@kowalski.gd>"
],

@@ -24,0 +25,0 @@ "main": "./index.js",

10

README.md

@@ -11,3 +11,3 @@ # k-bucket

[@tristanls](https://github.com/tristanls), [@mikedeboer](https://github.com/mikedeboer), [@deoxxa](https://github.com/deoxxa), [@feross](https://github.com/feross), [@nathanph](https://github.com/nathanph), [@allouis](https://github.com/allouis), [@fanatid](https://github.com/fanatid)
[@tristanls](https://github.com/tristanls), [@mikedeboer](https://github.com/mikedeboer), [@deoxxa](https://github.com/deoxxa), [@feross](https://github.com/feross), [@nathanph](https://github.com/nathanph), [@allouis](https://github.com/allouis), [@fanatid](https://github.com/fanatid), [@robertkowalski](https://github.com/robertkowalski)

@@ -113,2 +113,3 @@ ## Installation

* [kBucket.get(id)](#kbucketgetid)
* [kBucket.metadata](#kbucketmetadata)
* [kBucket.remove(id)](#kbucketremoveid)

@@ -145,2 +146,3 @@ * [kBucket.toArray()](#kbuckettoarray)

* `localNodeId`: _Buffer_ An optional Buffer representing the local node id. If not provided, a local node id will be created via `crypto.randomBytes(20)`.
* `metadata`: _Object_ _(Default: {})_ Optional satellite data to include with the k-bucket. `metadata` property is guaranteed not be altered, it is provided as an explicit container for users of k-bucket to store implementation-specific data.
* `numberOfNodesPerKBucket`: _Integer_ _(Default: 20)_ The number of nodes that a k-bucket can contain before being full or split.

@@ -181,2 +183,8 @@ * `numberOfNodesToPing`: _Integer_ _(Default: 3)_ The number of nodes to ping when a bucket that should not be split becomes full. KBucket will emit a `ping` event that contains `numberOfNodesToPing` nodes that have not been contacted the longest.

#### kBucket.metadata
* `metadata`: _Object_ _(Default: {})_
The `metadata` property serves as a container that can be used by implementations using k-bucket. One example is storing a timestamp to indicate the last time when a node in the bucket was responding to a ping.
#### kBucket.remove(id)

@@ -183,0 +191,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc