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

dfinity-radix-tree

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dfinity-radix-tree - npm Package Compare versions

Comparing version 0.1.4 to 0.1.5

17

datastore.js
const Buffer = require('safe-buffer').Buffer
const crypto = require('crypto')
const DAG = require('ipld-graph-builder/datastore.js')
const HASH_LEN = 20
const cbor = require('borc')
const HASH_LEN = 20
const LINK_TAG = 42
module.exports = class TreeDAG extends DAG {
async put (val) {
if (val[1]) {
val[1] = new cbor.Tagged(LINK_TAG, val[1]['/'])
}
if (val[2]) {
val[2] = new cbor.Tagged(LINK_TAG, val[2]['/'])
}
const encoded = cbor.encode(val)

@@ -27,2 +36,8 @@ const key = await TreeDAG.getMerkleLink(encoded)

const decoded = cbor.decode(val)
if (decoded[1]) {
decoded[1]['/'] = decoded[1].value
}
if (decoded[2]) {
decoded[2]['/'] = decoded[2].value
}
resolve(decoded)

@@ -29,0 +44,0 @@ }

2

package.json
{
"name": "dfinity-radix-tree",
"version": "0.1.4",
"version": "0.1.5",
"description": "This implements a binary merkle radix tree",

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