Skip to main content

pack

Function pack 

Source
pub fn pack(values: &[u64], width: u8) -> Option<Vec<u8>>
Expand description

Packs values into width bits each.

Values wider than width are truncated, which is why the caller derives the width from the data rather than choosing one. Each value is written with a single shifted accumulation rather than a loop over its bits.