mirror of
https://github.com/moltbot/moltbot.git
synced 2026-04-26 07:57:40 +00:00
11 lines
348 B
TypeScript
11 lines
348 B
TypeScript
import { DEFAULT_VIDEO_MAX_BASE64_BYTES } from "./defaults.js";
|
|
|
|
export function estimateBase64Size(bytes: number): number {
|
|
return Math.ceil(bytes / 3) * 4;
|
|
}
|
|
|
|
export function resolveVideoMaxBase64Bytes(maxBytes: number): number {
|
|
const expanded = Math.floor(maxBytes * (4 / 3));
|
|
return Math.min(expanded, DEFAULT_VIDEO_MAX_BASE64_BYTES);
|
|
}
|