Hello Mark,

[email protected] wrote:
I want to identify, with as much certainty as possible, whether a file is
lzip-compressed.
[...]
So I'd check whether something like this is true:
  (DS == 0x0C) || ( DS&0x1F > 12 && DS&0x1F < 30 )

However, should I relax or remove the dictionary size upper bound? A
future version of lzip might support larger dictionary sizes without any
other changes to the file format.

The maximum dictionary size LZMA can use is (4GiB -1), and the obvious way to code it is using the values 30, 31 and 00 to represent 1Gib, 2Gib and (4GiB -1) respectively in bits [4:0].

So a complete test, guaranteed to work for version 1 files produced by any future version of lzip, would be like this:
  ( DS & 0x1F ) > 12 || ( DS & 0x1F ) == 0 || DS == 12


Best regards,
Antonio.

_______________________________________________
Lzip-bug mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/lzip-bug

Reply via email to