public static MerkleHash Create(MerkleHash left, MerkleHash right) { return(Create(left.Value.Concat(right.Value).ToArray())); }
/// <summary> /// Constructor for a base node (leaf), representing the lowest level of the tree. /// </summary> public MerkleNode(MerkleHash hash) { Hash = hash; }
public MerkleHash ComputeHash(byte[] buffer) { Hash = MerkleHash.Create(buffer); return(Hash); }
// Override in derived class to extend the behavior. // Alternatively, we could implement a factory pattern. protected virtual MerkleNode CreateNode(MerkleHash hash) { return(new MerkleNode(hash)); }