cryptoutil

package
v0.2.21 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2026 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DigestSHA256Prefix = "sha256:"
)

Variables

This section is empty.

Functions

func IsDigestEqual

func IsDigestEqual(
	left *Digest,
	right *Digest,
) bool

func ValidateDigest

func ValidateDigest(value Digest) error

Types

type Digest

type Digest string

func CanonicalDigest added in v0.2.17

func CanonicalDigest(value any) (Digest, error)

func CloneDigest

func CloneDigest(value *Digest) *Digest

func DigestBytes

func DigestBytes(content []byte) Digest

DigestBytes returns the canonical sha256 digest representation used by the artifact store for arbitrary immutable content.

type DigestWriter added in v0.2.20

type DigestWriter struct {
	// contains filtered or unexported fields
}

DigestWriter incrementally calculates a Digest.

It implements io.Writer and is suitable for bounded streaming reads, directory fingerprints, and other inputs that should not be accumulated into one in-memory byte slice.

DigestWriter is not safe for concurrent use.

func NewDigestWriter added in v0.2.20

func NewDigestWriter() *DigestWriter

func (*DigestWriter) Digest added in v0.2.20

func (w *DigestWriter) Digest() Digest

Digest returns the current digest without changing writer state.

func (*DigestWriter) Write added in v0.2.20

func (w *DigestWriter) Write(value []byte) (int, error)

Jump to

Keyboard shortcuts

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