zserio.bitposition module¶
The module provides help methods for bit position calculation.
- zserio.bitposition.alignto(alignment_value: int, bitposition: int) int [source]¶
Aligns the bit size to the given alignment value.
- Parameters:
alignment_value – Value to align.
bitposition – Current bit position where to apply alignment.
- Returns:
Aligned bit position.
- zserio.bitposition.bits_to_bytes(numbits: int) int [source]¶
Converts number of bits to bytes.
- Parameters:
numbits – The number of bits to convert.
- Returns:
Number of bytes
- Raises:
PythonRuntimeException – If number of bits to convert is not divisible by 8.