util

package
v0.34.0 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrHashMalformed    = errors.New("malformed hash specifier")
	ErrHashUnrecognized = errors.New("unrecognized hash function")
)

Functions

func AssertValid

func AssertValid(verify types.Verification, data []byte) error

func GetHasher added in v0.7.1

func GetHasher(verify types.Verification) (hash.Hash, error)

func HashParts added in v0.23.0

func HashParts(v types.Verification) (string, string, error)

HashParts will return the sum and function (in that order) of the hash stored in this Verification, or an error if there is an issue during parsing.

Types

type ErrHashMismatch

type ErrHashMismatch struct {
	Calculated string
	Expected   string
}

ErrHashMismatch is returned when the calculated hash for a fetched object doesn't match the expected sum of the object.

func (ErrHashMismatch) Error

func (e ErrHashMismatch) Error() string

Directories

Path Synopsis
tools

Jump to

Keyboard shortcuts

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