1 unstable release
0.1.0 | Mar 7, 2023 |
---|
#112 in #checksum
6KB
89 lines
adler32_checksum_rs
Adler 32 checksum algorithm written for rust.
How to use
Sequel
fn adler32_checksum_blocking(init: [u8; 8], data: Vec<u8>) -> Adler32Result {
let adler = Adler32::new(init);
adler.adler32_checksum(data);
}
Batch
Synchronously
fn adler32_checksum_blocking(init: [u8; 8], data: Vec<Vec<u8>>) -> Vec<Adler32Result> {
let adler = Adler32::new(init);
data
.iter()
.map(|hash| {
adler.adler32_checksum(hash);
})
.collect();
}
Asynchronously
fn adler32_checksum_parallel(init: [u8; 8], data: Vec<Vec<u8>>) -> Vec<Adler32Result> {
Adler32Builder::new(Adler32::new(init))
.push_vec(data)
.finalize();
}
Dependencies
~8–19MB
~256K SLoC