hasher

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2021 License: BSD-2-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const HashersLen = BLAKE3_256 + 1 // 12

Variables

This section is empty.

Functions

This section is empty.

Types

type Hasher

type Hasher uint8

Hasher provides easy access to various different types of hashing algorithms

const (
	SHA2_224 Hasher = iota
	SHA2_256
	SHA2_384
	SHA2_512
	SHA3_224
	SHA3_256
	SHA3_384
	SHA3_512
	BLAKE2B_256
	BLAKE2B_384
	BLAKE2B_512
	BLAKE3_256
)

func (Hasher) Hash

func (h Hasher) Hash(data []byte) []byte

Compute hash of data, i.e. Hash(data)

func (Hasher) New

func (h Hasher) New() hash.Hash

Returns a new hasher object

func (Hasher) Size

func (h Hasher) Size() int

Returns the output size of the hash function

func (Hasher) String

func (h Hasher) String() string

Returns the string representation of the hash algorithm

func (Hasher) Zero

func (h Hasher) Zero() []byte

Returns the zero hash, i.e. Hash("")

Jump to

Keyboard shortcuts

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