Skip to content

CanonicalHash

Namespace: Vercel.AI.GenerateText

public static class CanonicalHash

Canonical JSON and SHA-256 digests used by tool fingerprints and approval signatures.

Inheritance: object

View source

public static string CanonicalJson(JsonElement value)

Serializes <code class=“paramref”>value</code> with sorted object keys.

Parameters

Name Type Description
value JsonElement

Returns: string

View source

public static string HashCanonical(JsonElement value)

SHA-256 digest of CanonicalJson(JsonElement), encoded as unpadded base64url.

Parameters

Name Type Description
value JsonElement

Returns: string

View source

public static string ToBase64Url(byte[] bytes)

Encodes <code class=“paramref”>bytes</code> as unpadded base64url.

Parameters

Name Type Description
bytes byte[]

Returns: string

View source

Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product