Example #1
0
 /// <summary>
 /// 왼쪽 Hash와 오른쪽 Hash를 연결하여 Hash값을 만든다.
 /// </summary>
 /// <param name="left"></param>
 /// <param name="right"></param>
 /// <returns></returns>
 public static MerkleHash Create(MerkleHash left, MerkleHash right)
 {
     return(Create(left.Value.Concat(right.Value).ToArray()));
 }
Example #2
0
        public MerkleHash ComputeHash(byte[] buffer)
        {
            Hash = MerkleHash.Create(buffer);

            return(Hash);
        }
Example #3
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));
        }
Example #4
0
 /// <summary>
 /// 생성자2
 /// </summary>
 /// <param name="hash"></param>
 public MerkleNode(MerkleHash hash)
 {
     Hash = hash;
 }
Example #5
0
 public MerkleProofHash(MerkleHash hash, Branch direction)
 {
     Hash      = hash;
     Direction = direction;
 }