Skip to content

Commit

Permalink
fix(zipcrack): 修复了zip破解文件大小不对的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
naocanmonster committed Dec 29, 2023
1 parent 45e424d commit f62f2fa
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/pages/zipcrack.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
},
Expand Down Expand Up @@ -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),
]
);
Expand Down

0 comments on commit f62f2fa

Please sign in to comment.