pub fn update_snapshot(input: &mut File, output: &mut File, password: &[u8]) -> crate::Result<()> {
    // setup the buffer to read from the old snapshot.
    let mut buffer: Vec<u8> = Vec::new();

    // check the file len
    check_file_len(input)?;

    // get the salt and ignore the version.
    let salt = get_salt(input, false)?;

    // decrypt the file into the buffer
    decrypt_file(input, &mut buffer, password, salt)?;

    // re-encrypt the file into a new snapshot.
    encrypt_snapshot(buffer, output, password)?;

    Ok(())
}
/// update a snapshot with the new version by re-encrypting the data.
update a snapshot with the new version by re-encrypting the data.
update a snapshot with the new version by re - encrypting the data .
pub fn update_snapshot(input: &mut File, output: &mut File, password: &[u8]) -> crate::Result<()> {
    // setup the buffer to read from the old snapshot.
    let mut buffer: Vec<u8> = Vec::new();
    // check the file len
    check_file_len(input)?;
    // get the salt and ignore the version.
    let salt = get_salt(input, false)?;
    // decrypt the file into the buffer
    decrypt_file(input, &mut buffer, password, salt)?;
    // re-encrypt the file into a new snapshot.
    encrypt_snapshot(buffer, output, password)?;
    Ok(())
}
pub fn update_snapshot ( input : & mut File , output : & mut File , password : & [ u8 ] ) -> crate :: Result < ( ) > { // setup the buffer to read from the old snapshot. let mut buffer : Vec < u8 > = Vec :: new ( ) ; // check the file len check_file_len ( input ) ? ; // get the salt and ignore the version. let salt = get_salt ( input , false ) ? ; // decrypt the file into the buffer decrypt_file ( input , & mut buffer , password , salt ) ? ; // re-encrypt the file into a new snapshot. encrypt_snapshot ( buffer , output , password ) ? ; Ok ( ( ) ) }
update a snapshot with the new version by re-encrypting the data.
update a snapshot with the new version by re - encrypting the data .
input
&mut File
output
&mut File
password
&[u8]