Namespace: merkletree

merkletree

Classes

MerkleTree

Methods

(static) checkMerkleProof(proof, root, element) → {bool}

checkMerkleProof - return true if the supplied merkle proof and element equate to the root element
Parameters:
Name Type Description
proof Array.<Buffer> an array of bytes32 elements that represent the merkle proof
root Buffer bytes32 of the root of the merkleTree
element Buffer hashed bytes32 leaf element to prove exists in the tree
Source:
Returns:
Type
bool

(static) concatBuffer(a, b, ordered)

concatBuffer - concat two buffers in byte order or in the order supplied depneding on the order flag
Parameters:
Name Type Description
a Buffer
b Buffer
ordered bool if true, concats a+b, if false then Buffer.compare sort a and b and then concat
Source:
Returns:
(Buffer)

(static) printTree(merkletree)

Internal printTree - function to pretty print each of the log(n) levels that make up the merkle tree
Parameters:
Name Type Description
merkletree MerkleTree
Source: