1.0.1 • Published 4 years ago

mtree v1.0.1

Weekly downloads
31
License
LGPL-3.0
Repository
gitlab
Last release
4 years ago

Mtree

JavaScript implementation of Merkle Trees.

Build Status Coverage Status NPM

Usage

Install with NPM.

npm install mtree --save

Use in your project.

var MerkleTree = require('mtree');
var tree = new MerkleTree([/* input hashes */]);

tree.depth(); // returns the tree depth
tree.levels(); // return the number of levels in tree
tree.level(2); // returns the nodes at the given level
tree.root(); // returns the merkle root for the tree
tree.nodes(); // returns the number of nodes in the tree

Run the tests.

npm run testsuite
npm run linter
npm run coverage