Skip to main content

Function: computeArtifactHash()

computeArtifactHash(content, hashContent, cleanups?): string

Defined in: packages/core/src/application/use-cases/_shared/compute-artifact-hash.ts:17

Computes a hash of artifact content after applying pre-hash cleanup rules.

Returns a hash string in the format produced by the supplied hashContent function (e.g. sha256:<hex>), consistent with the format used in metadata.json content hashes.

Parameters

content

string

The raw artifact content

hashContent

(content) => string

Function that computes a content hash string

cleanups?

readonly PreHashCleanup[] = []

Pre-hash cleanup rules to apply before hashing

Returns

string

The hash string