|
|
@@ -1,8 +1,6 @@
|
|
|
|
|
|
SINGLE_BIT_MASK = [1 << x for x in range(7, -1, -1)]
|
|
|
|
|
|
-]
|
|
|
-
|
|
|
class BitString(object):
|
|
|
|
|
|
def __init__(self, bytes, length=None, offset=None):
|
|
|
@@ -19,4 +17,4 @@ class BitString(object):
|
|
|
if key < 0 or key >= length:
|
|
|
raise IndexError()
|
|
|
byte_index, bit_offset = divmod(self.offset + key), 8)
|
|
|
- return self.bytes[byte_index] & SINGLE_BIT_MASK[bit_offset]
|
|
|
+ return self.bytes[byte_index] & SINGLE_BIT_MASK[bit_offset]
|