scott-griffiths / bitstring

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

Add offset to Dtype #332

Closed scott-griffiths closed 1 month ago

scott-griffiths commented 2 months ago

We already have an optional scale parameter. We could also add an offset. This would allow a type to represent offset ranges, for example

x = Dtype('u8', offset=1) # Has values 1 - 256