merkletreejs
Advanced tools
Comparing version 0.1.9 to 0.1.10
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", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
33076
6
528