merkle

package
v0.0.0-...-ceb2c1b Latest Latest
Warning

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

Go to latest
Published: May 18, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewStream

func NewStream(hasher NodeHasher, roots *[]Node, nodes *[]Node) *stream

Types

type BLAKE2b512

type BLAKE2b512 struct{}

func (BLAKE2b512) HashLeaf

func (b2b BLAKE2b512) HashLeaf(node PartialNode) []byte

func (BLAKE2b512) HashParent

func (b2b BLAKE2b512) HashParent(left, right Node) []byte

func (BLAKE2b512) Node

func (b2b BLAKE2b512) Node() Node

type DefaultNode

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

func (DefaultNode) Build

func (dn DefaultNode) Build(part PartialNode, hash []byte) Node

func (DefaultNode) Data

func (dn DefaultNode) Data() []byte

func (DefaultNode) Hash

func (dn DefaultNode) Hash() []byte

func (DefaultNode) Index

func (dn DefaultNode) Index() uint64

func (DefaultNode) Kind

func (dn DefaultNode) Kind() nodeKind

func (DefaultNode) Parent

func (dn DefaultNode) Parent() uint64

func (DefaultNode) String

func (dn DefaultNode) String() string

type Node

type Node interface {
	Index() uint64
	Parent() uint64
	Kind() nodeKind
	Hash() []byte
	Build(part PartialNode, hash []byte) Node
}

type NodeHasher

type NodeHasher interface {
	Node() Node
	HashLeaf(node PartialNode) []byte
	HashParent(left, right Node) []byte
}

type PartialNode

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

Jump to

Keyboard shortcuts

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