contextref

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package contextref provides the canonical content-reference minter and parser.

Index

Constants

View Source
const HashPrefix = "sha256:"

HashPrefix prefixes every canonical content address.

Variables

This section is empty.

Functions

func Digest

func Digest(chunks ...[]byte) string

Digest returns the SHA-256 of the concatenated chunks as 64 lowercase hex characters.

func IsLowerHex added in v0.3.0

func IsLowerHex(s string, n int) bool

IsLowerHex reports whether s is exactly n lowercase hex characters. It scans instead of allocating like strings.ToLower would. Exported so a caller checking its own fixed-length hex field (a signature, a public key) does not need a second copy of this scan.

func IsRef

func IsRef(ref string) bool

IsRef reports whether ref matches HashPrefix followed by 64 lowercase hex characters.

func Mint

func Mint(chunks ...[]byte) string

Mint returns HashPrefix plus Digest over the concatenated chunks.

Types

This section is empty.

Jump to

Keyboard shortcuts

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