mirror of
https://github.com/stablyai/orca.git
synced 2026-10-01 16:02:03 +00:00
8 lines
213 B
TypeScript
8 lines
213 B
TypeScript
export function formatBase64PayloadByteCount(base64: string): string {
|
|
try {
|
|
return `${Buffer.byteLength(base64, 'base64')} bytes`
|
|
} catch {
|
|
return `${Math.floor((base64.length * 3) / 4)} bytes`
|
|
}
|
|
}
|