You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It doesn't hang of corse if I pass just a subarray filetype(body.subarray(0, filetype.minimumBytes)) then everything works and { ext: 'zip', mime: 'application/zip' } is returned
The text was updated successfully, but these errors were encountered:
I am currently only passing a subarray length of minimumBytes, but wonder if there would be any benefit if I pass more than that, especially with application/zip data
I agree that this algorithm could be optimized for larger files. Expecially the findNextZipHeaderIndex function, which is using Array.findIndex(function). I will try to find a good solution and test for performance during the next few days. One idea is to use Buffer. indexOf() since we are looking for consecutive bytes.
I accidentally passed a bigger buffer to fileType,
i.e. this file https://imagemagick.org/download/windows/releases/ImageMagick-6.9.10-33.zip
Seems to hang iterating through the whole buffer here:
file-type/index.js
Line 275 in a1da90b
Is that expected?
It doesn't hang of corse if I pass just a subarray
filetype(body.subarray(0, filetype.minimumBytes))
then everything works and{ ext: 'zip', mime: 'application/zip' }
is returnedThe text was updated successfully, but these errors were encountered: