Re: Bit substring search

2008-06-25 Thread Kris Kennaway
Scott David Daniels wrote: Kris Kennaway wrote: Thanks for the pointers, I think a C extension will end up being the way to go, unless someone has beaten me to it and I just haven't found it yet. Depending on the pattern length you are targeting, it may be fastest to increase the out-of-loop

Re: Bit substring search

2008-06-25 Thread Scott David Daniels
Kris Kennaway wrote: Thanks for the pointers, I think a C extension will end up being the way to go, unless someone has beaten me to it and I just haven't found it yet. Depending on the pattern length you are targeting, it may be fastest to increase the out-of-loop work. For a 40-bit string, b

Re: Bit substring search

2008-06-24 Thread Kris Kennaway
[EMAIL PROTECTED] wrote: Kris Kennaway: Unfortunately I didnt find anything else useful here yet :( I see, I'm sorry, I have found hachoir quite nice in the past. Maybe there's no really efficient way to do it with Python, but you can create a compiled extension, so you can see if it's fast en

Re: Bit substring search

2008-06-24 Thread bearophileHUGS
Kris Kennaway: > Unfortunately I didnt find anything else useful here yet :( I see, I'm sorry, I have found hachoir quite nice in the past. Maybe there's no really efficient way to do it with Python, but you can create a compiled extension, so you can see if it's fast enough for your purposes. To

Re: Bit substring search

2008-06-24 Thread Kris Kennaway
[EMAIL PROTECTED] 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

Re: Bit substring search

2008-06-24 Thread bearophileHUGS
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:

Bit substring search

2008-06-24 Thread 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? This one comes close: http://ilan.schnell-web.net/prog/bitarray/ but it