From 6cedab89ae975cdeabd2eb0cf9c2fa91ec2b7f5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CNaeel=E2=80=9D?= Date: Mon, 29 Jun 2026 17:57:07 +0400 Subject: [PATCH] =?UTF-8?q?fix:=20chunked=20base64=20encoding=20to=20avoid?= =?UTF-8?q?=20JS=20argument=20overflow=20=E2=80=94=20v1.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deploy/services/drhider.py | 2 +- site/services/drhider.py | 2 +- site/templates/drhider.html | 9 +++++++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/deploy/services/drhider.py b/deploy/services/drhider.py index a4aa3f8..5487805 100644 --- a/deploy/services/drhider.py +++ b/deploy/services/drhider.py @@ -6,7 +6,7 @@ DrHider — обфускация документов (двухпроходна Согласованность: одна и та же сущность во всех файлах → одно и то же фиктивное значение. """ -DRHIDER_VERSION = "1.1" +DRHIDER_VERSION = "1.2" import io import csv import re diff --git a/site/services/drhider.py b/site/services/drhider.py index a4aa3f8..5487805 100644 --- a/site/services/drhider.py +++ b/site/services/drhider.py @@ -6,7 +6,7 @@ DrHider — обфускация документов (двухпроходна Согласованность: одна и та же сущность во всех файлах → одно и то же фиктивное значение. """ -DRHIDER_VERSION = "1.1" +DRHIDER_VERSION = "1.2" import io import csv import re diff --git a/site/templates/drhider.html b/site/templates/drhider.html index 4c4f2be..943c6c4 100644 --- a/site/templates/drhider.html +++ b/site/templates/drhider.html @@ -64,7 +64,7 @@ Сверка договоров | DrHider - v1.1 + v1.2
@@ -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с');