pub fn pad_with<F: Clone>(padding_value: F, data: &[F]) -> Vec<F>Expand description
Return a vector containing a padded version of the input data, with the
padding value at the end of the vector, such that the length is
data.len().next_power_of_two(). This is a no-op if the length is already
a power of two.
ยงExamples:
use remainder::utils::mle::pad_with;
let data = vec![1, 2, 3];
let padded_data = pad_with(0, &data);
assert_eq!(padded_data, vec![1, 2, 3, 0]);
assert_eq!(pad_with(0, &padded_data), vec![1, 2, 3, 0]); // length is already a power of two.