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.3.0 to 3.3.1

16

index.js

@@ -149,9 +149,2 @@ /*

var self = this
function sort (contacts) {
return contacts.slice().sort(function (a, b) {
return self.distance(a.id, id) - self.distance(b.id, id)
})
}
for (var nodes = [ this.root ], bitIndex = 0; nodes.length > 0 && contacts.length < n;) {

@@ -164,7 +157,12 @@ var node = nodes.pop()

} else {
contacts = contacts.concat(sort(node.contacts)).slice(0, n)
contacts = contacts.concat(node.contacts)
}
}
return contacts
var self = this
function compare (a, b) {
return self.distance(a.id, id) - self.distance(b.id, id)
}
return contacts.sort(compare).slice(0, n)
}

@@ -171,0 +169,0 @@

{
"name": "k-bucket",
"version": "3.3.0",
"version": "3.3.1",
"description": "Kademlia DHT K-bucket implementation as a binary tree",

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

"Kirill Fomichev <fanatid@ya.ru>",
"Robert Kowalski <rok@kowalski.gd>"
"Robert Kowalski <rok@kowalski.gd>",
"Nazar Mokrynskyi <nazar@mokrynskyi.com>"
],

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

@@ -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), [@robertkowalski](https://github.com/robertkowalski)
[@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), [@nazar-pc](https://github.com/nazar-pc)

@@ -14,0 +14,0 @@ ## Installation

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