Function byte_array_from_int_bit_array

Source
pub fn byte_array_from_int_bit_array(bits: &[u8]) -> Result<Vec<u8>>
Expand description

Convert a flat bit array (length multiple of 8) into bytes.

Ignores trailing bits < 8 (i.e., requires perfect multiple). If leftover bits exist, returns error to mirror strictness of original logic.

Returns error if any bit is not 0 or 1.