pub fn pad_to_fixed<'a>(
seq: &[u8],
max_len: usize,
buf: &'a mut [u8],
) -> &'a [u8] ⓘExpand description
Pad a variable-length sequence to a fixed width using the collision-free padding scheme.
seq: the extracted sequence (may be shorter thanmax_len)max_len: the maximum length (fromGeoLen::Range(_, max))buf: a caller-provided buffer of at leastmax_lenbytes
Returns a slice of buf containing the padded sequence (length == max_len).
If seq.len() == max_len, the original bytes are copied without padding.
If seq.len() < max_len, the appropriate padding suffix is appended.
§Panics
Panics if the deficit (max_len - seq.len()) exceeds [MAX_RANGE_WIDTH].