Skip to main content

pad_bytes

Function pad_bytes 

Source
pub fn pad_bytes<const ALIGN: usize>(n: usize) -> usize
Expand description

Returns the number of padding bytes needed to align n to ALIGN.

use lance_core::utils::bit::pad_bytes;

assert_eq!(pad_bytes::<8>(0), 0);
assert_eq!(pad_bytes::<8>(1), 7);
assert_eq!(pad_bytes::<8>(8), 0);
assert_eq!(pad_bytes::<8>(9), 7);