Documentation
¶
Index ¶
- type Hash
- type IdPathElement
- type Identity
- type MerkleTree
- func (m *MerkleTree) GetAllContent() []*TreeContent
- func (m *MerkleTree) GetIndexByValue(value *TreeContent) int
- func (m *MerkleTree) GetIntermediateValues(value *TreeContent) ([]*TreeContent, []int, *TreeContent)
- func (m *MerkleTree) GetPath(value *TreeContent) []byte
- func (m *MerkleTree) GetRoot() *TreeContent
- func (m *MerkleTree) Insert(value *TreeContent) (int, error)
- func (m *MerkleTree) IsExisted(value *TreeContent) bool
- func (m *MerkleTree) Len() int
- func (m *MerkleTree) Update(index uint, oldValue, newValue *TreeContent) error
- type Set
- type TreeContent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IdPathElement ¶
type IdPathElement struct {
// contains filtered or unexported fields
}
func NewIdPathElement ¶
func NewIdPathElement(t *TreeContent) *IdPathElement
func (*IdPathElement) BigInt ¶
func (i *IdPathElement) BigInt() *big.Int
func (*IdPathElement) Content ¶
func (i *IdPathElement) Content() TreeContent
func (*IdPathElement) Equal ¶
func (i *IdPathElement) Equal(oth IdPathElement) bool
func (*IdPathElement) Hex ¶
func (i *IdPathElement) Hex() string
func (*IdPathElement) String ¶
func (i *IdPathElement) String() string
type Identity ¶
type Identity string
Identity ...
func NewIdentityFromBytes ¶
NewIdentityFromBytes ...
type MerkleTree ¶
type MerkleTree struct {
// contains filtered or unexported fields
}
MerkleTree ...
func (*MerkleTree) GetAllContent ¶
func (m *MerkleTree) GetAllContent() []*TreeContent
GetAllContent .
func (*MerkleTree) GetIndexByValue ¶
func (m *MerkleTree) GetIndexByValue(value *TreeContent) int
GetIndexByValue .
func (*MerkleTree) GetIntermediateValues ¶
func (m *MerkleTree) GetIntermediateValues(value *TreeContent) ([]*TreeContent, []int, *TreeContent)
GetIntermediateValues : get all intermediate values of a leaf
func (*MerkleTree) GetPath ¶
func (m *MerkleTree) GetPath(value *TreeContent) []byte
GetPath : get merkle path of a leaf
func (*MerkleTree) GetRoot ¶
func (m *MerkleTree) GetRoot() *TreeContent
GetRoot : get current merkle root
func (*MerkleTree) Insert ¶
func (m *MerkleTree) Insert(value *TreeContent) (int, error)
Insert : insert into to the merkle tree
func (*MerkleTree) IsExisted ¶
func (m *MerkleTree) IsExisted(value *TreeContent) bool
IsExisted ...
func (*MerkleTree) Update ¶
func (m *MerkleTree) Update(index uint, oldValue, newValue *TreeContent) error
Update : update a leaf of this merkle tree
type TreeContent ¶
type TreeContent struct {
// contains filtered or unexported fields
}
TreeContent ...
func NewTreeContent ¶
func NewTreeContent(value *big.Int) *TreeContent
func (TreeContent) BigInt ¶
func (t TreeContent) BigInt() *big.Int
func (TreeContent) Bytes ¶
func (t TreeContent) Bytes() []byte
func (TreeContent) CalculateHash ¶
func (t TreeContent) CalculateHash() ([]byte, error)
CalculateHash hashes the values of a TreeContent
func (TreeContent) Equals ¶
func (t TreeContent) Equals(other merkletree.Content) (bool, error)
Equals tests for equality of two Contents
func (TreeContent) Hex ¶
func (t TreeContent) Hex() string
func (TreeContent) String ¶
func (t TreeContent) String() string
Click to show internal directories.
Click to hide internal directories.