From f62f2faeb8b20f2350cbb06c4d89a8ce774f7f83 Mon Sep 17 00:00:00 2001 From: naocanmonster Date: Fri, 29 Dec 2023 11:43:17 +0800 Subject: [PATCH] =?UTF-8?q?fix(zipcrack):=20=E4=BF=AE=E5=A4=8D=E4=BA=86zip?= =?UTF-8?q?=E7=A0=B4=E8=A7=A3=E6=96=87=E4=BB=B6=E5=A4=A7=E5=B0=8F=E4=B8=8D?= =?UTF-8?q?=E5=AF=B9=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/zipcrack.tsx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/pages/zipcrack.tsx b/src/pages/zipcrack.tsx index 08a6a93..7ebf88b 100644 --- a/src/pages/zipcrack.tsx +++ b/src/pages/zipcrack.tsx @@ -77,10 +77,6 @@ const Hash: React.FC = () => { setData(e.target.result as ArrayBuffer); } }; - if (files[0].size > 1024 * 1024) { - message('暂不支持处理超过 1MB 的文件'); - return; - } setFileName(files[0].name); reader.readAsArrayBuffer(files[0]); }, @@ -121,7 +117,7 @@ const Hash: React.FC = () => { [ maxLength, alphabet.split('').sort().join(''), - new Uint8Array(data, 0, 50 * 1024), + new Uint8Array(data, 0, Math.min(data.byteLength, 50 * 1024)), Math.min(data.byteLength, 50 * 1024), ] );