hash

package
v0.12.13 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2026 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DirectoryHash

func DirectoryHash(srcPath string, excludePatterns, includeFiles []string) (string, error)

DirectoryHash computes a hash of the directory contents using the standard dirhash.Hash1 algorithm. It supports filtering via exclude patterns (.dockerignore) and include filters (specific subdirectories). It processes up to maxFilesToRead files. If this limit is exceeded, it returns a warning error along with a partial hash computed from the first 5000 files.

The hash format is "h1:" followed by base64-encoded SHA-256, compatible with go.sum format.

Parameters:

  • srcPath: The directory path to hash
  • excludePatterns: Patterns to exclude from hashing (e.g., .dockerignore patterns)
  • includeFiles: Specific files to include in the hash

Returns:

  • hash: "h1:" format hash of the directory contents (may be partial if limit exceeded)
  • error: nil on success, warning error if file limit exceeded, or actual error on failure

Types

This section is empty.

Jump to

Keyboard shortcuts

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