Skip to content

LIBERATED AI CHAT

TypeScript

fix: remove incorrect alignment comment in utf8ToBase64

faber2658bf15e43b
diff --git a/functions/api/telemetry.ts b/functions/api/telemetry.ts
index 4b532b6..faefd8b 100644
--- a/functions/api/telemetry.ts
+++ b/functions/api/telemetry.ts
@@ -462,7 +462,7 @@ async function sha256Hex(str: string): Promise<string> {
// creating a single enormous string via Array.from() on the full input.
function utf8ToBase64(content: string): string {
const bytes = new TextEncoder().encode(content)
- const CHUNK = 32 * 1024 // 32 KiB — 3-byte aligned (32768 % 3 = 0)
+ const CHUNK = 32 * 1024
let binStr = ''
for (let i = 0; i < bytes.length; i += CHUNK) {
const slice = bytes.subarray(i, Math.min(i + CHUNK, bytes.length))