narinfo

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const HashPattern = `[0-9a-df-np-sv-z]{32}`

narInfoHashPattern defines the valid characters for a Nix32 encoded hash. Nix32 uses a 32-character alphabet excluding 'e', 'o', 'u', and 't'. Valid characters: 0-9, a-d, f-n, p-s, v-z Hashes must be exactly 32 characters long.

Variables

View Source
var (
	// ErrInvalidHash is returned if the hash is invalid.
	ErrInvalidHash = errors.New("invalid narinfo hash")
)

Functions

func FilePath

func FilePath(hash string) (string, error)

FilePath returns the path of the narinfo file given a hash.

func ValidateHash

func ValidateHash(hash string) error

ValidateHash validates the given hash according to Nix32 encoding requirements. A valid hash must: - Be exactly 32 characters long - Contain only characters from the Nix32 alphabet ('0'-'9', 'a'-'z' excluding 'e', 'o', 'u', 't').

Types

This section is empty.

Jump to

Keyboard shortcuts

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