예제 #1
0
 public static MerkleHash Create(MerkleHash left, MerkleHash right)
 {
     return(Create(left.Value.Concat(right.Value).ToArray()));
 }
예제 #2
0
 /// <summary>
 ///     Constructor for a base node (leaf), representing the lowest level of the tree.
 /// </summary>
 public MerkleNode(MerkleHash hash)
 {
     Hash = hash;
 }
예제 #3
0
        public MerkleHash ComputeHash(byte[] buffer)
        {
            Hash = MerkleHash.Create(buffer);

            return(Hash);
        }
예제 #4
0
        // 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));
        }