Adding mutating methods to ConstByteStore
Used internally - not part of public interface.
Definition at line 221 of file bitstring.py.
◆ invertbit()
def invertbit |
( |
|
self, |
|
|
|
pos |
|
) |
| |
Definition at line 238 of file bitstring.py.
238 def invertbit(self, pos):
239 assert 0 <= pos < self.bitlength
240 byte, bit = divmod(self.offset + pos, 8)
241 self._rawarray[byte] ^= (128 >> bit)
242
◆ setbit()
Definition at line 228 of file bitstring.py.
228 def setbit(self, pos):
229 assert 0 <= pos < self.bitlength
230 byte, bit = divmod(self.offset + pos, 8)
231 self._rawarray[byte] |= (128 >> bit)
232
◆ setbyte()
def setbyte |
( |
|
self, |
|
|
|
pos, |
|
|
|
value |
|
) |
| |
Definition at line 243 of file bitstring.py.
243 def setbyte(self, pos, value):
244 self._rawarray[pos] = value
245
◆ setbyteslice()
def setbyteslice |
( |
|
self, |
|
|
|
start, |
|
|
|
end, |
|
|
|
value |
|
) |
| |
Definition at line 246 of file bitstring.py.
246 def setbyteslice(self, start, end, value):
247 self._rawarray[start:end] = value
248
249
◆ unsetbit()
def unsetbit |
( |
|
self, |
|
|
|
pos |
|
) |
| |
Definition at line 233 of file bitstring.py.
233 def unsetbit(self, pos):
234 assert 0 <= pos < self.bitlength
235 byte, bit = divmod(self.offset + pos, 8)
236 self._rawarray[byte] &= ~(128 >> bit)
237
◆ __slots__
The documentation for this class was generated from the following file: