Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PutHasher ¶ added in v1.6.0
func PutHasher(hasher *OpinionHasher)
PutHasher resets the hasher and puts it back to the pool.
Types ¶
type OpinionHasher ¶
type OpinionHasher struct {
// contains filtered or unexported fields
}
OpinionHasher is a utility for computing opinion hash.
func GetHasher ¶ added in v1.6.0
func GetHasher() *OpinionHasher
GetHasher will get an OpinionHasher from the pool. It may or may not allocate a new one. Consumers are not required to call Reset() on the hasher before putting it back in the pool.
func (*OpinionHasher) Hash ¶
func (h *OpinionHasher) Hash() (rst types.Hash32)
Hash instantiates 32bytes and write hash.Sum to it.
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.
Click to show internal directories.
Click to hide internal directories.