integrity

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 13, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package integrity provides Subresource Integrity helpers.

Index

Constants

View Source
const (
	CDXSHA256 = "SHA-256"
	CDXSHA384 = "SHA-384"
	CDXSHA512 = "SHA-512"
)

CycloneDX hash-algorithm names, the mirror of the SRI algorithm prefixes (sha256/384/512).

Variables

This section is empty.

Functions

func FormatSRI

func FormatSRI(cdxAlg, hexDigest string) (string, error)

FormatSRI encodes a CycloneDX algorithm name and hex digest as an SRI string.

func ParseSRI

func ParseSRI(sri string) (alg, hexDigest string, err error)

ParseSRI decodes a Subresource Integrity string ("sha384-<base64>") into a CycloneDX hash algorithm name ("SHA-384") and hex-encoded digest.

Types

This section is empty.

Jump to

Keyboard shortcuts

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