bojand / infer

Small crate to infer file and MIME type by checking the magic number signature
MIT License
299 stars 28 forks source link

Add bzip3 and LZ4 support #98

Open sorairolake opened 4 months ago

sorairolake commented 4 months ago

bzip3 is a better, faster and stronger spiritual successor to bzip2. This is available in the official repositories of many systems:

Packaging status

LZ4 is a lossless compression algorithm that is focused on compression and decompression speed. This is used in many system software. This is available in the official repositories of many systems:

Packaging status

archive::is_lz4 does not support legacy formats (support v1.4+ only). This is similar to archive::is_zst. The magic number was changed almost 10 years ago, so it doesn't matter for practical purposes.

I don't know how to generate skippable frames, so I haven't tested it. However, skippable frames in Zstandard are compatible with skippable frames in LZ4.^1 Since archive::is_lz4 is based on archive::is_zst, so this should work fine.

Resources