merkletree

package
v0.18.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 13, 2023 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const HashLen = 32

Variables

This section is empty.

Functions

This section is empty.

Types

type CollapsedTree

type CollapsedTree struct {
	// contains filtered or unexported fields
}

func CloneCollapsedTree

func CloneCollapsedTree(source *CollapsedTree) *CollapsedTree

func EmptyCollapsedTree

func EmptyCollapsedTree() *CollapsedTree

func NewCollapsedTree

func NewCollapsedTree(nodes []Hash, size uint64) (*CollapsedTree, error)

func (*CollapsedTree) Add

func (tree *CollapsedTree) Add(hash Hash)

func (*CollapsedTree) Append added in v0.17.0

func (tree *CollapsedTree) Append(other *CollapsedTree) error

func (*CollapsedTree) CalculateRoot

func (tree *CollapsedTree) CalculateRoot() Hash

func (CollapsedTree) Equal added in v0.17.0

func (tree CollapsedTree) Equal(other CollapsedTree) bool

func (CollapsedTree) MarshalJSON

func (tree CollapsedTree) MarshalJSON() ([]byte, error)

func (*CollapsedTree) Size

func (tree *CollapsedTree) Size() uint64

func (*CollapsedTree) UnmarshalJSON

func (tree *CollapsedTree) UnmarshalJSON(b []byte) error

type Hash

type Hash [HashLen]byte

func HashChildren

func HashChildren(left Hash, right Hash) Hash

func HashLeaf

func HashLeaf(leafBytes []byte) Hash

func HashNothing

func HashNothing() Hash

func (Hash) Base64String

func (h Hash) Base64String() string

func (Hash) MarshalBinary added in v0.17.0

func (h Hash) MarshalBinary() ([]byte, error)

func (Hash) MarshalJSON

func (h Hash) MarshalJSON() ([]byte, error)

func (*Hash) UnmarshalBinary added in v0.17.0

func (h *Hash) UnmarshalBinary(hashBytes []byte) error

func (*Hash) UnmarshalJSON

func (h *Hash) UnmarshalJSON(b []byte) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL