#checksum #hash #api

adler32_checksum_rs

Adler32 checksum

1 unstable release

0.1.0 Mar 7, 2023

#153 in #checksum

Custom license

6KB
89 lines

adler32_checksum_rs

License Issues CI Activity Version

Adler 32 checksum algorithm written for rust.

Wikipedia

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
~264K SLoC