checksum

package
v0.89.0 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package checksum computes and verifies file checksums.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSHA256Hash

func GetSHA256Hash(data io.Reader) (string, error)

GetSHA256Hash returns the SHA256 hash of data read from the provided reader.

func GetSHA256OfFile

func GetSHA256OfFile(path string) (string, error)

GetSHA256OfFile returns the SHA256 hash of the provided file.

func VerifyFile

func VerifyFile(path string, algorithm api.ChecksumAlgorithm, digest string) error

VerifyFile checks a file against the expected digest using the given algorithm.

Types

type Entry added in v0.89.0

type Entry struct {
	Digest string
	Path   string
}

Entry identifies a checksummed package file.

func Parse added in v0.89.0

func Parse(data []byte) ([]Entry, error)

Parse returns the checksum entries encoded in a checksums.txt file.

Jump to

Keyboard shortcuts

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