Open
Description
Ref. https://www.npmjs.com/package/file-type#usage – we should be fine with reading only the magic bytes at the beginning of the file.
file-type
can sometimes work with as few as 4 bytes (e.g., for PNGs), some formats (like ISO files) need up to 4100 bytes. A buffer of 8KB (8192 bytes) is probably the ceiling on how much data should we wait for before being able to do the sniffing, passing anything more than that
Right now, the amount of passed data depends on codec-specific plugin. For dag-pb we seem to pass entire block, so the amount of data passed is way to high 256KiB up to 1MiB: