depend on crc32fast
We can use this to compute fast checksums to test file integrity (not crypto safe).
This commit is contained in:
parent
3025b3a53c
commit
a7f67a9a9c
|
@ -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 = []
|
||||||
|
|
|
@ -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()
|
||||||
|
|
Loading…
Reference in New Issue