// 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)); }
public MerkleHash ComputeHash(byte[] buffer) { Hash = MerkleHash.Create(buffer); return(Hash); }
public static MerkleHash ComputeHash(MerkleHash left, MerkleHash right) { return(MerkleHash.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; }