deltakit.core.decoding_graphs.FixedWidthBitstring#

class deltakit.core.decoding_graphs.FixedWidthBitstring(width: int, value: int = 0)#

Bases: Bitstring

Class which represents a fixed precision bitstring.

Methods#

FixedWidthBitstring.bit_count

Get the number of 1s in this bitstring.

FixedWidthBitstring.change_width

Change the width of this bitstring internally.

FixedWidthBitstring.from_bits

Create a bitstring from a list of bits.

FixedWidthBitstring.from_bytes

Create a bitstring from a collection of bytes.

FixedWidthBitstring.from_indices

Create a bitstring from a list of non-zero indices.

FixedWidthBitstring.to_indices

Create a list of indices of the non-zero elements in this bitstring

FixedWidthBitstring.to_words

Convert the bitstring into words of a given length.