[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Lzip-bug] Identifying lzip-compressed files

From: markk
Subject: [Lzip-bug] Identifying lzip-compressed files
Date: Sun, 20 Mar 2011 21:03:10 -0000
User-agent: SquirrelMail/1.4.21


I want to identify, with as much certainty as possible, whether a file is

Bytes 0-3 must be 'LZIP' and byte 4 must be 0 or 1.

Byte 5 is the coded dictionary size. Since dictionary size is 4KB-512MB
bits [4:0] (when considered as a 5-bit number) must between 12 and 29. And
if bits [4:0] are 12 then bits [7:5] must be 0.

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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]