check

package
v0.0.0-...-165f8d8 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SHA1 校验和算法-sha1
	SHA1 = "SHA1"
	// SHA256 校验和算法-sha256
	SHA256 = "SHA256"
	// SHA512 校验和算法-sha512
	SHA512 = "SHA512"
)

Variables

View Source
var (
	// ErrUnsupportedChecksumAlgorithm 不支持的校验和算法
	ErrUnsupportedChecksumAlgorithm = errors.New("unsupported checksum algorithm")
	// ErrChecksumNotMatched 校验和不匹配
	ErrChecksumNotMatched = errors.New("file checksum does not match the computed checksum")
)

Functions

func VerifyChecksum

func VerifyChecksum(filename string, sumURL string, algorithm string) (bool, error)

VerifyChecksum checks whether SHA1 sum of the content of filename equals the one posted on the sumURL.

Types

This section is empty.

Jump to

Keyboard shortcuts

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