Methods
Static computeRoot
- computeRoot(leaves, algorithm?): string
Parameters
- leaves: string[]
- algorithm: string = 'sha256'
Returns string
Static computeProof
- computeProof(leaves, leafIndex, algorithm?): MerkleProof
Parameters
- leaves: string[]
- leafIndex: number
- algorithm: string = 'sha256'
Returns MerkleProof
Static verifyProof
- verifyProof(proof, algorithm?): boolean
Parameters
- proof: MerkleProof
- algorithm: string = 'sha256'
Returns boolean
Compute the Merkle root of a list of leaf hashes. If the number of leaves is odd, the last leaf is duplicated. Returns empty string for empty input.