hashes

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2023 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SHA256    Algo = "SHA256"    //SHA 256
	RIPEMD160      = "RIPEMD160" //RIPEMD 160
	SHA3256        = "SHA3256"   //SHA3 256
)

Variables

This section is empty.

Functions

func Hash

func Hash(src io.Reader, hash hash.Hash) error

func HashCopy

func HashCopy(dst io.Writer, src io.Reader, hash hash.Hash) (written int64, err error)

func MultiHash

func MultiHash(src io.Reader, hashMap map[Algo]hash.Hash) error

Types

type Algo

type Algo string

Represents a name of a particular hashing algorithm at a particluar length.

func ParseAlgo

func ParseAlgo(Name string) (Algo, error)

Returns the Algo corresponding to Name, returns an error if Name does not represent an existing Algo

func (Algo) New

func (r Algo) New() hash.Hash

Returns a usable hash.Hash interface. If the receiver is not a valid name for a supported hash function, the method panics.

func (*Algo) UnmarshalText

func (r *Algo) UnmarshalText(text []byte) error

func (Algo) Validate

func (r Algo) Validate() error

Jump to

Keyboard shortcuts

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