Skip to main content

Module bits

Module bits 

Source
Expand description

Bitfield extraction, checksums, and header trait. Bitfield extraction, checksums, and header trait.

Functionsยง

check_bits_u8
Returns true if any bit in mask is set in bitmap.
checksum_u8
Computes an XOR checksum over a byte slice.
get_bits_u8
Returns the bits from bitmap specified by mask, right-aligned.
get_bits_u16
Returns the bits from bitmap specified by mask, right-aligned.
get_bits_u32
Returns the bits from bitmap specified by mask, right-aligned.
min_len
Returns the minimum number of bytes required to represent the given u64 value.
set_bits_u8
Returns bitmap with the bits specified by mask set to value.
set_bits_u16
Returns bitmap with the bits specified by mask set to value.
set_bits_u32
Returns bitmap with the bits specified by mask set to value.
validate_checksum_u8
Returns true if the XOR checksum of the slice (including the checksum byte) is zero.