mirror of
https://github.com/morluto/rea.git
synced 2026-11-18 20:53:00 +00:00
* refactor(zip): read EOCD and trailing archive fields via BinaryReader * perf(domain): avoid subarray allocations in BinaryReader and prefilter EOCD scan Check field bounds via a private helper and read 16-, 32-, and 64-bit integers directly from BinaryReader.bytes by offset instead of slicing via range(), and skip non-0x50 bytes before full signature comparison in zipEndOfCentralDirectoryCandidates. * perf(zip): scan EOCD signature candidates with Buffer.lastIndexOf Jump directly between 4-byte EOCD signatures with Buffer.lastIndexOf instead of probing every byte in JavaScript, preserving reverse candidate order, earliest-offset bounds, and zero-copy Uint8Array views. * perf(zip): bound EOCD lastIndexOf scan to the 65557-byte tail window Slice a zero-copy tail view starting at earliest before calling Buffer.lastIndexOf so exhausting zipEndOfCentralDirectoryCandidates on large archives never scans bytes before the maximum comment window.