hash

package
v0.7.7 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AlgoString

func AlgoString(alg crypto.Hash) string

AlgoString returns string of hash algorithm.

func Algorithm

func Algorithm(s string) (crypto.Hash, error)

Algorithm returns crypto.Hash from string.

func AlgorithmList

func AlgorithmList(sep string) string

AlgorithmList returns string of hash functions list.

func Check

func Check(alg crypto.Hash, r io.Reader, hashStr string) (bool, error)

Check function returns true if computed hash value is match.

func CheckFile

func CheckFile(alg crypto.Hash, path string, hashStr string) (bool, error)

Check function returns true if computed hash value is match.

func Value

func Value(alg crypto.Hash, r io.Reader) ([]byte, error)

Value returns hash value string from io.Reader

func ValueFromBytes

func ValueFromBytes(alg crypto.Hash, b []byte) ([]byte, error)

ValueFromBytes returns hash value string from []byte

Types

type Checker

type Checker interface {
	Path() string
	Err() error
	Check() error
}

func NewCheckers

func NewCheckers(r io.Reader, alg crypto.Hash) ([]Checker, error)

NewCheckers returns list of Checker instances from io.Reader.

Jump to

Keyboard shortcuts

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