MerkleTree class

A time-based Merkle Tree implementation. It buckets items based on their last updated HLC timestamp.

Constructors

MerkleTree(MerkleNode root)
Creates a MerkleTree with the given root node.

Properties

hashCode int
The hash code for this object.
no setterinherited
root MerkleNode
The root node of the tree.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

getNode(String prefix) MerkleNode?
Get the node for a specific prefix inside this tree.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

build(List<MapEntry<String, String>> items) MerkleTree
Builds a Merkle Tree from a map of HLC strings to content hashes.
combineHashes(List<String> hashes) String
Combines multiple hashes into a single hash. Sorts the input hashes to ensure the result is deterministic and order-independent.
computeRoot(List<String> validContentHashes) String
Computes the Merkle Root for a list of content hashes (Legacy flat implementation logic). This is used for backward compatibility or simple lists without HLC available.
deterministicJsonEncode(dynamic data) String
Encodes a map into a JSON string with sorted keys to ensure deterministic results.
hash(String content) String
Computes a SHA-256 hash of the given string content.
override