opinionhash

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OpinionHasher

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

OpinionHasher is a utility for computing opinion hash.

func New

func New() *OpinionHasher

New returns new instance of the opinion hasher.

func (*OpinionHasher) Hash

func (h *OpinionHasher) Hash() (rst types.Hash32)

Hash instantiates 32bytes and write hash.Sum to it.

func (*OpinionHasher) Reset

func (h *OpinionHasher) Reset()

Reset opinion hasher state.

func (*OpinionHasher) Sum

func (h *OpinionHasher) Sum(dst []byte) []byte

Sum appends hash sum to dst.

func (*OpinionHasher) WriteAbstain

func (h *OpinionHasher) WriteAbstain()

WriteAbstain writes abstain sentinel as an opinion.

func (*OpinionHasher) WritePrevious

func (h *OpinionHasher) WritePrevious(hash types.Hash32)

WritePrevious aggregated hash.

func (*OpinionHasher) WriteSupport

func (h *OpinionHasher) WriteSupport(id types.BlockID, height uint64)

WriteSupport writes id and height of the block.

Jump to

Keyboard shortcuts

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