New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

merk

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

merk

Node.js bindings for Merk

latest
Source
npmnpm
Version
2.1.4
Version published
Weekly downloads
52
-1.89%
Maintainers
1
Weekly downloads
 
Created
Source

node-merk

Node.js bindings for Merk

Usage

npm install merk

let { Merk, verifyProof } = require('merk')

// create or load store
let db = Merk('./state.db')

// get value
let value = db.getSync(Buffer.from('mykey'))

// get Merkle root
let hash = db.rootHash()

// create merkle proof
let keys = [
  Buffer.from('key1'),
  Buffer.from('key2')
]
let proof = db.proveSync(keys)

// verify a merkle proof
let proofResult = verifyProof(proof, keys, db.rootHash())

// modify values
db.batch()
  .put(Buffer.from('key1'), Buffer.from('value1'))
  .put(Buffer.from('key2'), Buffer.from('value2'))
  .delete(Buffer.from('key3'))
  .commitSync()

FAQs

Package last updated on 14 Nov 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts