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

merkletreejs

Package Overview
Dependencies
Maintainers
1
Versions
78
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

merkletreejs - npm Package Compare versions

Comparing version 0.1.9 to 0.1.10

index.d.ts

22

dist/index.d.ts
interface Options {
/** If set to `true`, an odd node will be duplicated and combined to make a pair to generate the layer hash. */
duplicateOdd: boolean;
duplicateOdd?: boolean;
/** If set to `true`, the leaves will hashed using the set hashing algorithms. */
hashLeaves: boolean;
hashLeaves?: boolean;
/** If set to `true`, constructs the Merkle Tree using the [Bitcoin Merkle Tree implementation](http://www.righto.com/2014/02/bitcoin-mining-hard-way-algorithms.html). Enable it when you need to replicate Bitcoin constructed Merkle Trees. In Bitcoin Merkle Trees, single nodes are combined with themselves, and each output hash is hashed again. */
isBitcoinTree: boolean;
isBitcoinTree?: boolean;
/** If set to `true`, the leaves will be sorted. */
sortLeaves: boolean;
sortLeaves?: boolean;
/** If set to `true`, the hashing pairs will be sorted. */
sortPairs: boolean;
sortPairs?: boolean;
/** If set to `true`, the leaves and hashing pairs will be sorted. */
sort: boolean;
sort?: boolean;
}
declare type THashAlgo = any;
declare type TValue = any;
declare type TLeaf = any;
declare type TLayer = any;
/**

@@ -21,7 +25,7 @@ * Class reprensenting a Merkle Tree

duplicateOdd: boolean;
hashAlgo: (value: any) => any;
hashAlgo: (value: TValue) => THashAlgo;
hashLeaves: boolean;
isBitcoinTree: boolean;
leaves: any[];
layers: any[];
leaves: TLeaf[];
layers: TLayer[];
sortLeaves: boolean;

@@ -28,0 +32,0 @@ sortPairs: boolean;

@@ -187,3 +187,2 @@ "use strict";

var pairIndex = (isRightNode ? index - 1 : index);
var position = isRightNode ? 'left' : 'right';
if (pairIndex < layer.length) {

@@ -190,0 +189,0 @@ proof.push({

{
"name": "merkletreejs",
"version": "0.1.9",
"version": "0.1.10",
"description": "Construct Merkle Trees and verify proofs",
"main": "dist/index.js",
"types": "index.d.ts",
"files": ["dist"],
"files": ["dist", "index.d.ts"],
"scripts": {

@@ -9,0 +9,0 @@ "test": "tape test/*.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