Skip to content

ByteEncoding

Namespace: Vercel.AI.ProviderUtils

public static class ByteEncoding

Base64 conversions for inline file bytes.

Inheritance: object

View source

public static string ConvertToBase64(byte[] value)

Encodes bytes as base64.

Parameters

Name Type Description
value byte[]

Returns: string

View source

public static string ConvertToBase64(string value)

Returns base64 text unchanged, or encodes bytes.

Parameters

Name Type Description
value string

Returns: string

View source

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[]

View source

public static string ToBase64(byte[] bytes)

Encodes bytes as standard base64.

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