Skip to content

Latest commit

 

History

History
25 lines (18 loc) · 417 Bytes

MerkleTree.md

File metadata and controls

25 lines (18 loc) · 417 Bytes

MerkleTree(哈希树)

| 参考

结构

type MerkleNode struct {
	Left  *MerkleNode
	Right *MerkleNode
	Data  []byte
}

type MerkleTree struct {
	RootNode *MerkleNode
}

方法

func NewMerkleNode(left, right *MerkleNode, data []byte) *MerkleNode //新建一个节点
func NewMerkleTree(data [][]byte) *MerkleTree //新建一个树