depend on crc32fast

We can use this to compute fast checksums to test file integrity (not crypto safe).
This commit is contained in:
Dietmar Maurer 2019-06-21 15:58:00 +02:00
parent 3025b3a53c
commit a7f67a9a9c
2 changed files with 8 additions and 0 deletions

View File

@ -49,6 +49,7 @@ xdg = "2.2"
mio = "0.6" mio = "0.6"
valgrind_request = { version = "1.1", optional = true } valgrind_request = { version = "1.1", optional = true }
textwrap = "0.11" textwrap = "0.11"
crc32fast = "1"
[features] [features]
default = [] default = []

View File

@ -27,6 +27,13 @@ fn main() -> Result<(), Error> {
let input = proxmox::sys::linux::random_data(1024*1024)?; let input = proxmox::sys::linux::random_data(1024*1024)?;
rate_test("crc32", &|| {
let mut crchasher = crc32fast::Hasher::new();
crchasher.update(&input);
let _checksum = crchasher.finalize();
input.len()
});
rate_test("zstd", &|| { rate_test("zstd", &|| {
zstd::block::compress(&input, 1).unwrap(); zstd::block::compress(&input, 1).unwrap();
input.len() input.len()