fix: chunked base64 encoding to avoid JS argument overflow — v1.2
Deploy contracts-flask / validate (push) Successful in 0s

This commit is contained in:
2026-06-29 17:57:07 +04:00
parent 2197b7e526
commit 6cedab89ae
3 changed files with 9 additions and 4 deletions
+7 -2
View File
@@ -64,7 +64,7 @@
<a href="/">Сверка договоров</a>
<span class="sep">|</span>
<strong>DrHider</strong>
<span style="font-size:11px;color:var(--muted);">v1.1</span>
<span style="font-size:11px;color:var(--muted);">v1.2</span>
</header>
<main>
@@ -126,7 +126,12 @@ BTN.onclick = async () => {
const payload = [];
for (const f of files) {
const buf = await f.arrayBuffer();
const b64 = btoa(String.fromCharCode(...new Uint8Array(buf)));
const bytes = new Uint8Array(buf);
let b64 = '';
for (let i = 0; i < bytes.length; i += 8192) {
b64 += String.fromCharCode.apply(null, bytes.slice(i, i + 8192));
}
b64 = btoa(b64);
payload.push({name: f.name, data: b64, type: f.type || ''});
}
setStatus('progress', '⏳ Обработка... 0с');