keccak

package
v0.0.0-...-f672fcd Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Keccak256

func Keccak256(dst, src []byte) []byte

Keccak256 hashes a src with keccak-256

func Keccak256Rlp

func Keccak256Rlp(dst []byte, src *fastrlp.Value) []byte

Keccak256Rlp hashes a fastrlp.Value with keccak-256

func PrefixedKeccak256Rlp

func PrefixedKeccak256Rlp(prefix, dst []byte, src *fastrlp.Value) []byte

PrefixedKeccak256Rlp hashes a fastrlp.Value using keccak-256 with the given prefix

Types

type Keccak

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

Keccak is the sha256 keccak hash

func NewKeccak256

func NewKeccak256() *Keccak

NewKeccak256 returns a new keccak 256

func (*Keccak) Read

func (k *Keccak) Read() []byte

Read hashes the content and returns the intermediate buffer.

func (*Keccak) Reset

func (k *Keccak) Reset()

Reset implements the hash interface

func (*Keccak) Sum

func (k *Keccak) Sum(dst []byte) []byte

Sum implements the hash interface

func (*Keccak) Write

func (k *Keccak) Write(b []byte) (int, error)

Write implements the hash interface

func (*Keccak) WriteFn

func (k *Keccak) WriteFn(dst []byte, marshalFn func([]byte) []byte) []byte

WriteFn writes using value provided by custom marshalFn func

func (*Keccak) WriteRlp

func (k *Keccak) WriteRlp(dst []byte, v *fastrlp.Value) []byte

WriteRlp writes an RLP value

type Pool

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

Pool is a pool of keccaks

var DefaultKeccakPool Pool

DefaultKeccakPool is a default pool

func (*Pool) Get

func (p *Pool) Get() *Keccak

Get returns the keccak

func (*Pool) Put

func (p *Pool) Put(k *Keccak)

Put releases the keccak

Jump to

Keyboard shortcuts

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