Documentation
¶
Overview ¶
Package integrity implements checksum verification for downloaded assets.
Only SHA-256 is supported today. Checksums are expressed as "<algorithm>:<hex>" strings inside manifests.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrMismatch = fmt.Errorf("checksum mismatch")
ErrMismatch is returned when a checksum does not match the expected value.
Functions ¶
func HashBytes ¶
HashBytes returns the "<algo>:<hex>" digest of data. It panics if algo is unsupported; callers that want to recover from an unsupported algorithm should use Parse first.
func Parse ¶
Parse splits an "<algo>:<hex>" checksum into its components. It returns an error if the algorithm is not recognised or the hex part is empty.
func VerifyFile ¶
VerifyFile checks that the contents of path match expected. expected must be of the form "<algo>:<hex>".
Types ¶
This section is empty.