Skip to main content

HashIdentifierExceptVersion

Computes a hash for a given identifier, excluding the version from the hash calculation. This supports cache hits across different versions of the same resource.

def HashIdentifierExceptVersion(
ctx: context.Context,
id: *core.Identifier
) - > string

Computes a hash string for a given identifier, excluding the version field. This function is used to support cache hits across different versions of the same resource by ensuring the hash remains consistent.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for the operation, typically used for cancellation or deadlines.
id*core.IdentifierThe identifier object for which the hash needs to be computed. Its ResourceType, Project, Domain, Name, and Org fields will be used.

Returns

TypeDescription
stringThe computed hash string for the identifier, or an empty string if an error occurs.