CanonicalHash
Namespace: Vercel.AI.GenerateText
public static class CanonicalHashCanonical JSON and SHA-256 digests used by tool fingerprints and approval signatures.
Inheritance: object
Methods
Section titled “Methods”CanonicalJson(JsonElement)
Section titled “CanonicalJson(JsonElement)”public static string CanonicalJson(JsonElement value)Serializes <code class=“paramref”>value</code> with sorted object keys.
Parameters
| Name | Type | Description |
|---|---|---|
value |
JsonElement |
Returns: string
HashCanonical(JsonElement)
Section titled “HashCanonical(JsonElement)”public static string HashCanonical(JsonElement value)SHA-256 digest of CanonicalJson(JsonElement), encoded as unpadded base64url.
Parameters
| Name | Type | Description |
|---|---|---|
value |
JsonElement |
Returns: string
ToBase64Url(byte[])
Section titled “ToBase64Url(byte[])”public static string ToBase64Url(byte[] bytes)Encodes <code class=“paramref”>bytes</code> as unpadded base64url.
Parameters
| Name | Type | Description |
|---|---|---|
bytes |
byte[] |
Returns: string
Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product