use crate::{BigUInt, property::IsBigInt, digit::Digit};
impl<T: Copy + Default + Digit, const LEN: usize> BigUInt<T, LEN> {
/// resize a biguint, expand and set high bits to 0 if new length is larger,
/// shrink and cut off higher bits if new length is smaller
pub fn resize<const L: usize>(self) -> BigUInt<T, L> {
let mut output = BigUInt::ZERO;
if L >= LEN {
output[..LEN].copy_from_slice(&self.0)
} else {
output.copy_from_slice(&self.0[..L])
}
output
}
}