Skip to content
1 min read · 99 words

Function: canonicalFingerprint()

ts
function canonicalFingerprint(value: unknown): Promise<string>;

Defined in: src/batteries/llm/chat_common/helpers.ts:967

Computes a SHA-256 fingerprint of value via canonical canonicalisation, over its UTF-8 bytes, using globalThis.crypto.subtle.digest.

Parameters

ParameterType
valueunknown

Returns

Promise<string>

Remarks

Wire-shape-agnostic replay-prefix fingerprinting primitive shared across the Chat-family LLM batteries' "reasoning replay" features (Anthropic's signed thinking blocks, and any sibling battery's equivalent). Each battery assembles its own wire-shaped prefix object — e.g. { model, system, tools, messages } for Anthropic Messages — and passes it here; this primitive carries no knowledge of any individual wire shape.