hash

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Combine

func Combine(l, r []byte) []byte

func MerkleCascade

func MerkleCascade(cascade, hashList [][]byte, maxHeight int64) [][]byte

MerkleCascade calculates a Merkle cascade for a hash list. MerkleCascade can add hashes to an existing cascade or calculate a new cascade. If maxHeight is positive, MerkleCascade will stop at that height.

Types

type Hasher

type Hasher [][]byte

func (*Hasher) AddBigInt

func (h *Hasher) AddBigInt(v *big.Int)

func (*Hasher) AddBool

func (h *Hasher) AddBool(v bool)

func (*Hasher) AddBytes

func (h *Hasher) AddBytes(v []byte)

func (*Hasher) AddDuration

func (h *Hasher) AddDuration(v time.Duration)

func (*Hasher) AddEnum

func (h *Hasher) AddEnum(v interface{ ID() uint64 })

func (*Hasher) AddHash

func (h *Hasher) AddHash(v *[32]byte)

func (*Hasher) AddHash2

func (h *Hasher) AddHash2(v [32]byte)

func (*Hasher) AddInt

func (h *Hasher) AddInt(v int64)

func (*Hasher) AddString

func (h *Hasher) AddString(v string)

func (*Hasher) AddTime

func (h *Hasher) AddTime(v time.Time)

func (*Hasher) AddTxID

func (h *Hasher) AddTxID(v *url.TxID)

func (*Hasher) AddUint

func (h *Hasher) AddUint(v uint64)

func (*Hasher) AddUrl

func (h *Hasher) AddUrl(v *url.URL)

func (*Hasher) AddUrl2

func (h *Hasher) AddUrl2(v *url.URL)

func (*Hasher) AddValue

func (h *Hasher) AddValue(v interface{ MerkleHash() []byte })

func (Hasher) MerkleHash

func (h Hasher) MerkleHash() []byte

func (Hasher) Receipt

func (h Hasher) Receipt(start, anchor int) *merkle.Receipt

Receipt returns a receipt for the numbered element. Receipt returns nil if either index is out of bounds.

Jump to

Keyboard shortcuts

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