Пример #1
0
        public MerkleHash ComputeHash(byte[] buffer)
        {
            Hash = MerkleHash.Create(buffer);

            return(Hash);
        }
Пример #2
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));
        }
Пример #3
0
 /// <summary>
 ///     Constructor for a base node (leaf), representing the lowest level of the tree.
 /// </summary>
 public MerkleNode(MerkleHash hash)
 {
     Hash = hash;
 }
Пример #4
0
 public static MerkleHash ComputeHash(MerkleHash left, MerkleHash right)
 {
     return(MerkleHash.Create(left.Value.Concat(right.Value).ToArray()));
 }