deltakit.core.decoding_graphs.Bitstring#

class deltakit.core.decoding_graphs.Bitstring(value: int = 0)#

Bases: object

Class which efficiently represents a bitstring.

Methods#

Bitstring.bit_count

Get the number of 1s in this bitstring.

Bitstring.from_bits

Create a bitstring from a list of bits.

Bitstring.from_bytes

Create a bitstring from a collection of bytes.

Bitstring.from_indices

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

Bitstring.to_indices

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

Bitstring.to_words

Convert the bitstring into words of a given length.