scott-griffiths / bitstring

A Python module to help you manage your bits
https://bitstring.readthedocs.io/en/stable/index.html
MIT License
404 stars 68 forks source link

Bits.findall does not support LSB0 numbering #236

Closed andreas-0815-qwertz closed 1 year ago

andreas-0815-qwertz commented 1 year ago

I am a happy user of the experimental LSB0 support. Bits.findall still returns indices in MSB0.

Currently, I am using the following workaround for the results of Bits.findall (with bs being an instance of Bits):

list(reversed( [len(bs) + (-i - 1) for i in bs.findall([1])]

I am using bitring version 3.1.9.

scott-griffiths commented 1 year ago

Hi. Yes you're right that findall isn't working with lsb0 yet. I'm trying to fix the remaining issues with the LSB0 to finally release it as a proper feature in version 4, but there are still quite a few edge cases to test and fix.

There's better support for LSB0 on the main branch (and the 4.0-update branch), but not yet for findall.

Thanks.

scott-griffiths commented 1 year ago

There are still a few known issues with streaming methods, but the basic functionality should all be there in version 4.0 (including findall).

andreas-0815-qwertz commented 1 year ago

Works like a charm. Thanks, @scott-griffiths 😁