merkletree

package
v0.1.0-alpha Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OrderOfData

func OrderOfData(indexList []int64) int

OrderOfData return data's order as slice's order (slice's first index is 0) merkletree's MerklePath return rootPath, indexes. indexes is indicate whether the leaf is left of right. so, you can find the order of the data in indexes.

func ValidatePath

func ValidatePath(data Data, rootHash RootHash, rootPath RootPath, indexList []int64) bool

Types

type Data

type Data struct {
	Content content
}

func NewData

func NewData(data []byte) Data

func (Data) Bytes

func (d Data) Bytes() []byte

func (Data) CalculateHash

func (d Data) CalculateHash() ([]byte, error)

func (Data) Equals

func (d Data) Equals(a Data) (bool, error)

type MerkleData

type MerkleData = merkletree.Content

type RootHash

type RootHash []byte

type RootPath

type RootPath [][]byte

type Wrapper

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

func New

func New(dataList []Data) (*Wrapper, error)

func (*Wrapper) MerklePath

func (w *Wrapper) MerklePath(data Data) (RootPath, []int64, error)

func (*Wrapper) MerkleRoot

func (w *Wrapper) MerkleRoot() RootHash

Jump to

Keyboard shortcuts

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