Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hypertrie

Package Overview
Dependencies
Maintainers
1
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hypertrie - npm Package Compare versions

Comparing version 2.1.0 to 3.0.0

10

lib/node.js

@@ -15,2 +15,3 @@ const sodium = require('sodium-universal')

this.keySplit = split(this.key)
this.metadata = false
this.hash = hash(this.keySplit)

@@ -20,3 +21,3 @@ this.trie = data.trieBuffer ? trie.decode(data.trieBuffer) : (data.trie || [])

this.valueBuffer = null
this.length = this.hash.length * 4 + 1
this.length = this.hash.length * 4 + 1 + 1
this.valueEncoding = enc

@@ -30,2 +31,4 @@ }

Node.prototype.path = function (i) {
if (!i) return this.metadata ? 1 : 0
i--
const hash = this.hash

@@ -44,4 +47,5 @@ const j = i >> 2

Node.prototype.collides = function (node, i) {
if (!i) return false
if (i === this.length - 1) return this.key !== node.key
const j = Math.floor(i / 32)
const j = Math.floor((i - 1) / 32)
return this.keySplit[j] !== node.keySplit[j]

@@ -55,3 +59,3 @@ }

Node.terminator = function (i) {
return ((i + 1) & 31) === 0
return (i & 31) === 0
}

@@ -58,0 +62,0 @@

{
"name": "hypertrie",
"version": "2.1.0",
"version": "3.0.0",
"description": "Distributed single writer key/value store",

@@ -5,0 +5,0 @@ "main": "index.js",

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