src/backup/data_blob.rs: add is_encrypted helper

This commit is contained in:
Dietmar Maurer 2020-09-24 12:36:04 +02:00
parent 6fd129844d
commit c0fa14d94a

View File

@ -271,6 +271,12 @@ impl DataBlob {
} }
} }
/// Returns if chunk is encrypted
pub fn is_encrypted(&self) -> bool {
let magic = self.magic();
magic == &ENCR_COMPR_BLOB_MAGIC_1_0 || magic == &ENCRYPTED_BLOB_MAGIC_1_0
}
/// Verify digest and data length for unencrypted chunks. /// Verify digest and data length for unencrypted chunks.
/// ///
/// To do that, we need to decompress data first. Please note that /// To do that, we need to decompress data first. Please note that