pub fn pad(data: &[u8]) -> Vec<u8> {
    if is_valid_size(data) {
        return data.into();
    }

    let current_length = data.len();
    let next_multiple_length = calculate_resize(data.len());
    let mut buffer = data.to_vec();
    buffer.resize(
        next_multiple_length,
        (next_multiple_length - current_length) as u8,
    );
    buffer
}
/// will add padding to the end of a vector to ensure its size is a multiple of 16
/// the number that gets added indicates how much padding was added
will add padding to the end of a vector to ensure its size is a multiple of 16
the number that gets added indicates how much padding was added
will add padding to the end of a vector to ensure its size is a multiple of 16 the number that gets added indicates how much padding was added
pub fn pad(data: &[u8]) -> Vec<u8> {
    if is_valid_size(data) {
        return data.into();
    }
    let current_length = data.len();
    let next_multiple_length = calculate_resize(data.len());
    let mut buffer = data.to_vec();
    buffer.resize(
        next_multiple_length,
        (next_multiple_length - current_length) as u8,
    );
    buffer
}
pub fn pad ( data : & [ u8 ] ) -> Vec < u8 > { if is_valid_size ( data ) { return data . into ( ) ; } let current_length = data . len ( ) ; let next_multiple_length = calculate_resize ( data . len ( ) ) ; let mut buffer = data . to_vec ( ) ; buffer . resize ( next_multiple_length , ( next_multiple_length - current_length ) as u8 , ) ; buffer }
will add padding to the end of a vector to ensure its size is a multiple of 16
the number that gets added indicates how much padding was added
will add padding to the end of a vector to ensure its size is a multiple of 16 the number that gets added indicates how much padding was added
data
&[u8]
data
&[u8]