Documentation
¶
Overview ¶
Package sum provides checksum storage and calculation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Fnv128aPath ¶
Fnv128aPath returns the base64-encoded FNV-128a hash of the file at p.
func PathMatchesHash ¶
func PathMatchesHash(p string, hasher HashPathFunc, expected string) (bool, error)
PathMatchesHash check if the file at the given path matches the given hash when hashed with hasher. If the target does not exist the functions returns (false, nil) as if the hash did not match.
func Sha512Path ¶
Sha512Path returns the base64-encoded SHA-512 hash of the file at p.
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB is a key-value store for checksum entries.
type Entry ¶
type Entry struct {
URLTemplate string
InArchive string
OS string
Arch string
Sum string
Comment string
}
Entry represents a single checksum record.
type HashPathFunc ¶
HashPathFunc is a function that hashes the file at the given path and returns the base64 encoded hash.
Click to show internal directories.
Click to hide internal directories.