UNPKG

@chainsafe/persistent-merkle-tree

Version:

Merkle tree implemented as a persistent datastructure

37 lines 1.26 kB
import { hasher as nobleHasher } from "./noble.js"; export * from "./types.js"; export * from "./util.js"; /** * Hasher used across the SSZ codebase, by default, this does not support batch hash. */ export let hasher = nobleHasher; /** * Set the hasher to be used across the SSZ codebase * * WARNING: This function is intended for power users and must be executed before any other SSZ code is imported */ export function setHasher(newHasher) { hasher = newHasher; } export function hashInto(data, output) { hasher.hashInto(data, output); } export function digest64(a, b) { return hasher.digest64(a, b); } export function digest64Into(a, b, output) { hasher.digest64Into(a, b, output); } export function digestNLevel(data, nLevel) { return hasher.digestNLevel(data, nLevel); } export function merkleizeBlocksBytes(blocksBytes, padFor, output, offset) { hasher.merkleizeBlocksBytes(blocksBytes, padFor, output, offset); } export function merkleizeBlockArray(blocks, blockLimit, padFor, output, offset) { hasher.merkleizeBlockArray(blocks, blockLimit, padFor, output, offset); } export function executeHashComputations(hashComputations) { hasher.executeHashComputations(hashComputations); } //# sourceMappingURL=index.js.map