checksum

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func VerifyFile

func VerifyFile(algo Algorithm, expectedChecksum, filename string) (err error)

VerifyFile 检查目标文件校验和

Types

type Algorithm

type Algorithm string

Algorithm 校验和算法

const (
	// SHA256 校验和算法-sha256
	SHA256 Algorithm = "SHA256"
	// SHA1 校验和算法-sha1
	SHA1 Algorithm = "SHA1"
)

Jump to

Keyboard shortcuts

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