integrity

package
v0.4.10 Latest Latest
Warning

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

Go to latest
Published: May 18, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package integrity provides checksum and payload hash computation for snapshots.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComputeDescriptorChecksum

func ComputeDescriptorChecksum(desc *model.Descriptor) (model.HashValue, error)

ComputeDescriptorChecksum computes SHA-256 checksum of the descriptor. Excludes: descriptor_checksum, integrity_state (per spec 04) Includes all other fields to ensure tamper detection.

func ComputePayloadRootHash

func ComputePayloadRootHash(root string) (model.HashValue, error)

ComputePayloadRootHash computes a deterministic hash of the entire payload tree. Algorithm: walk in byte-order sorted path order, compute per-entry hash, concatenate all lines, hash the result.

func ComputePayloadRootHashWithExclusions

func ComputePayloadRootHashWithExclusions(root string, excluded func(rel string) bool) (model.HashValue, error)

ComputePayloadRootHashWithExclusions computes a payload hash while skipping any workspace-relative paths reported as excluded.

Types

type PayloadRootHashStats added in v0.4.10

type PayloadRootHashStats struct {
	Entries     int64
	Files       int64
	Directories int64
	Symlinks    int64
	Bytes       int64
}

func ComputePayloadRootHashWithExclusionsAndStats added in v0.4.10

func ComputePayloadRootHashWithExclusionsAndStats(root string, excluded func(rel string) bool) (model.HashValue, PayloadRootHashStats, error)

func ComputePayloadRootHashWithStats added in v0.4.10

func ComputePayloadRootHashWithStats(root string) (model.HashValue, PayloadRootHashStats, error)

Jump to

Keyboard shortcuts

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