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

            return(Hash);
        }
Beispiel #5
0
 public MerkleProofHash(MerkleHash hash, Branch direction)
 {
     Hash      = hash;
     Direction = direction;
 }