/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 * @generated-id: 598522066688
 */
import * as z from "zod/v4";
export function bytesToBase64(u8arr) {
    return btoa(String.fromCodePoint(...u8arr));
}
export function bytesFromBase64(encoded) {
    return Uint8Array.from(atob(encoded), (c) => c.charCodeAt(0));
}
export function stringToBytes(str) {
    return new TextEncoder().encode(str);
}
export function stringFromBytes(u8arr) {
    return new TextDecoder().decode(u8arr);
}
export function stringToBase64(str) {
    return bytesToBase64(stringToBytes(str));
}
export function stringFromBase64(b64str) {
    return stringFromBytes(bytesFromBase64(b64str));
}
export const zodOutbound = z.custom(x => x instanceof Uint8Array)
    .or(z.string().transform(stringToBytes));
export const zodInbound = z.custom(x => x instanceof Uint8Array)
    .or(z.string().transform(bytesFromBase64));
//# sourceMappingURL=base64.js.map