blake2bstream

package
v0.2.16 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2023 License: MPL-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

View Source
const (
	HashID = "b2b"
)

Variables

This section is empty.

Functions

func Register

func Register(algs h2streamhash.Algs)

Register registers a hash alg

Types

type Config

type Config struct {
	Key []byte
}

func NewConfig

func NewConfig() (*Config, error)

func ParseConfig

func ParseConfig(params string) (*Config, error)

ParseConfig loads a blake2b key config from params string

func (Config) String

func (c Config) String() string

type Hash

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

Hash implements h2streamhash.Hash for blake2b

func NewHash

func NewHash(config Config) (*Hash, error)

NewHash creates a new blake2b stream hash

func (*Hash) Close

func (h *Hash) Close() error

Close implements h2streamhash.Hash

func (*Hash) ID added in v0.2.14

func (h *Hash) ID() string

func (*Hash) Sum

func (h *Hash) Sum() string

Sum returns a checksum

func (*Hash) Verify

func (h *Hash) Verify(checksum string) (bool, error)

func (*Hash) Write

func (h *Hash) Write(src []byte) (int, error)

Write implements io.Writer

type Hasher

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

Hasher implements h2streamhash.Hasher for blake2b

func NewHasher

func NewHasher(config Config) *Hasher

New creates a new blake2b hasher

func NewHasherFromParams

func NewHasherFromParams(params string) (*Hasher, error)

NewHasherFromParams creates a blake2b hasher from params

func (*Hasher) Hash

func (h *Hasher) Hash() (h2streamhash.Hash, error)

func (*Hasher) ID

func (h *Hasher) ID() string

func (*Hasher) Verify

func (h *Hasher) Verify(checksum string) (h2streamhash.Hash, error)

Jump to

Keyboard shortcuts

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