ByteEncoding
Namespace: Vercel.AI.ProviderUtils
public static class ByteEncodingBase64 conversions for inline file bytes.
Inheritance: object
Methods
Section titled “Methods”ConvertToBase64(byte[])
Section titled “ConvertToBase64(byte[])”public static string ConvertToBase64(byte[] value)Encodes bytes as base64.
Parameters
| Name | Type | Description |
|---|---|---|
value |
byte[] |
Returns: string
ConvertToBase64(string)
Section titled “ConvertToBase64(string)”public static string ConvertToBase64(string value)Returns base64 text unchanged, or encodes bytes.
Parameters
| Name | Type | Description |
|---|---|---|
value |
string |
Returns: string
FromBase64(string)
Section titled “FromBase64(string)”public static byte[] FromBase64(string text)Decodes standard or base64url text. An empty string decodes to an empty array.
Parameters
| Name | Type | Description |
|---|---|---|
text |
string |
Returns: byte[]
ToBase64(byte[])
Section titled “ToBase64(byte[])”public static string ToBase64(byte[] bytes)Encodes bytes as standard base64.
Parameters
| Name | Type | Description |
|---|---|---|
bytes |
byte[] |
Returns: string
Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product