Documentation ¶
Index ¶
- Constants
- func CountTrailingZeros(n uint32) uint32
- func LeafNode(keyHash *Hash, depth uint8) uint32
- func NewQueue(capacity uint32) *queue
- func ParentNode(node uint32) uint32
- type MerkleTree
- func (tree *MerkleTree) Depth() uint8
- func (tree *MerkleTree) IsLeaf(nodeID uint32) bool
- func (tree *MerkleTree) LeafNode(key []byte) uint32
- func (tree *MerkleTree) LeftChild(node uint32) uint32
- func (tree *MerkleTree) Level(nodeID uint32) uint8
- func (tree *MerkleTree) NodeHash(node uint32) Hash
- func (tree *MerkleTree) NodeLimit() uint32
- func (tree *MerkleTree) PreviewUpdate(update *Update) (map[uint32]Hash, map[uint32]map[string]Hash)
- func (tree *MerkleTree) RangeHash(rangeMin uint32, rangeMax uint32) Hash
- func (tree *MerkleTree) RightChild(node uint32) uint32
- func (tree *MerkleTree) RootHash() Hash
- func (tree *MerkleTree) RootNode() uint32
- func (tree *MerkleTree) SetNodeHash(nodeID uint32, hash Hash)
- func (tree *MerkleTree) SetNodeHashes(nodeHashes map[uint32]Hash)
- func (tree *MerkleTree) SubRangeMax(nodeID uint32) uint32
- func (tree *MerkleTree) SubRangeMin(nodeID uint32) uint32
- func (tree *MerkleTree) TranslateNode(nodeID uint32, depth uint8) uint32
- func (tree *MerkleTree) UndoUpdate(update *Update)
- func (tree *MerkleTree) Update(update *Update) (map[uint32]bool, map[uint32]map[string]Hash)
- func (tree *MerkleTree) UpdateLeafHash(nodeID uint32, hash Hash)
Constants ¶
View Source
const MerkleDefaultDepth uint8 = 19
View Source
const MerkleMaxDepth uint8 = 28 // 4GB
View Source
const MerkleMinDepth uint8 = 1
MerkleMaxDepth should never exceed 32
Variables ¶
This section is empty.
Functions ¶
func CountTrailingZeros ¶
func ParentNode ¶
Types ¶
type MerkleTree ¶
type MerkleTree struct {
// contains filtered or unexported fields
}
func NewDummyMerkleTree ¶
func NewDummyMerkleTree(depth uint8) (*MerkleTree, error)
func NewMerkleTree ¶
func NewMerkleTree(depth uint8) (*MerkleTree, error)
func (*MerkleTree) Depth ¶
func (tree *MerkleTree) Depth() uint8
func (*MerkleTree) IsLeaf ¶
func (tree *MerkleTree) IsLeaf(nodeID uint32) bool
func (*MerkleTree) LeafNode ¶
func (tree *MerkleTree) LeafNode(key []byte) uint32
func (*MerkleTree) LeftChild ¶
func (tree *MerkleTree) LeftChild(node uint32) uint32
func (*MerkleTree) Level ¶
func (tree *MerkleTree) Level(nodeID uint32) uint8
func (*MerkleTree) NodeHash ¶
func (tree *MerkleTree) NodeHash(node uint32) Hash
func (*MerkleTree) NodeLimit ¶
func (tree *MerkleTree) NodeLimit() uint32
func (*MerkleTree) PreviewUpdate ¶
func (tree *MerkleTree) PreviewUpdate(update *Update) (map[uint32]Hash, map[uint32]map[string]Hash)
func (*MerkleTree) RangeHash ¶
func (tree *MerkleTree) RangeHash(rangeMin uint32, rangeMax uint32) Hash
func (*MerkleTree) RightChild ¶
func (tree *MerkleTree) RightChild(node uint32) uint32
func (*MerkleTree) RootHash ¶
func (tree *MerkleTree) RootHash() Hash
func (*MerkleTree) RootNode ¶
func (tree *MerkleTree) RootNode() uint32
func (*MerkleTree) SetNodeHash ¶
func (tree *MerkleTree) SetNodeHash(nodeID uint32, hash Hash)
func (*MerkleTree) SetNodeHashes ¶
func (tree *MerkleTree) SetNodeHashes(nodeHashes map[uint32]Hash)
func (*MerkleTree) SubRangeMax ¶
func (tree *MerkleTree) SubRangeMax(nodeID uint32) uint32
func (*MerkleTree) SubRangeMin ¶
func (tree *MerkleTree) SubRangeMin(nodeID uint32) uint32
func (*MerkleTree) TranslateNode ¶
func (tree *MerkleTree) TranslateNode(nodeID uint32, depth uint8) uint32
func (*MerkleTree) UndoUpdate ¶
func (tree *MerkleTree) UndoUpdate(update *Update)
func (*MerkleTree) Update ¶
func (tree *MerkleTree) Update(update *Update) (map[uint32]bool, map[uint32]map[string]Hash)
func (*MerkleTree) UpdateLeafHash ¶
func (tree *MerkleTree) UpdateLeafHash(nodeID uint32, hash Hash)
this
Click to show internal directories.
Click to hide internal directories.