/// <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())); }
public MerkleHash ComputeHash(byte[] buffer) { Hash = MerkleHash.Create(buffer); return(Hash); }
// 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)); }
/// <summary> /// 생성자2 /// </summary> /// <param name="hash"></param> public MerkleNode(MerkleHash hash) { Hash = hash; }
public MerkleProofHash(MerkleHash hash, Branch direction) { Hash = hash; Direction = direction; }