hashfile

package
v1.226.0-test.1 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package hashfile computes a deterministic content+filename hash over a set of file paths, the shared hashing primitive behind pkg/runner/freshness's checksum.changed fact.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HashFiles

func HashFiles(paths []string) (string, error)

HashFiles computes a deterministic hash over paths: sorted first (so input order never affects the result), then path+content streamed into one sha256 digest (the path, not just its base name, is included so both a rename and a move between directories that share a filename are detected even when content is unchanged). Each record is length-prefixed (see writeRecord) so no concatenation of two records can ever collide with a different pair of path/content values. Returns the full hex-encoded digest; callers wanting a short prefix (e.g. cache keys) can slice it.

Types

This section is empty.

Jump to

Keyboard shortcuts

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