Bit substring search
kris at FreeBSD.org
Tue Jun 24 15:51:53 CEST 2008
bearophileHUGS at lycos.com wrote:
> Kris Kennaway:
>> I am trying to parse a bit-stream file format (bzip2) that does not have
>> byte-aligned record boundaries, so I need to do efficient matching of
>> bit substrings at arbitrary bit offsets.
>> Is there a package that can do this?
> You may take a look at Hachoir or some other modules:
Thanks. hachoir also comes close, but it also doesnt seem to be able to
match substrings at a bit level (e.g. the included bzip2 parser just
reads the header and hands the entire file off to libbzip2 to extract
construct exports a bit stream but it's again pure python and matching
substrings will be slow. It will need C support to do that efficiently.
> Etc. More:
Unfortunately I didnt find anything else useful here yet :(
More information about the Python-list