Debian Codegraph @

.cargo/vendor/adler2/README.md

raw
1 # Adler-32 checksums for Rust
2
3 This is a fork of the adler crate as the [original](https://github.com/jonas-schievink/adler) has been archived and is no longer updated by it's author
4
5 [![crates.io](https://img.shields.io/crates/v/adler.svg)](https://crates.io/crates/adler)
6 [![docs.rs](https://docs.rs/adler/badge.svg)](https://docs.rs/adler/)
7 ![CI](https://github.com/jonas-schievink/adler/workflows/CI/badge.svg)
8
9 This crate provides a simple implementation of the Adler-32 checksum, used in
10 the zlib compression format.
11
12 Please refer to the [changelog](CHANGELOG.md) to see what changed in the last
13 releases.
14
15 ## Features
16
17 - Permissively licensed (0BSD) clean-room implementation.
18 - Zero dependencies.
19 - Zero `unsafe`.
20 - Decent performance (3-4 GB/s) (see note).
21 - Supports `#![no_std]` (with `default-features = false`).
22
23 ## Usage
24
25 Add an entry to your `Cargo.toml`:
26
27 ```toml
28 [dependencies]
29 adler2 = "2.0.0"
30 ```
31
32 Check the [API Documentation](https://docs.rs/adler/) for how to use the
33 crate's functionality.
34
35 ## Rust version support
36
37 Currently, this crate supports all Rust versions starting at Rust 1.56.0.
38
39 Bumping the Minimum Supported Rust Version (MSRV) is *not* considered a breaking
40 change, but will not be done without good reasons. The latest 3 stable Rust
41 versions will always be supported no matter what.
42
43 ## Performance
44
45 Due to the way the algorithm works this crate and the fact that it's not possible to use explicit simd in safe rust currently, this crate benefits drastically from being compiled with newer cpu instructions enabled (using e.g ```RUSTFLAGS=-C target-feature'+sse4.1``` or ```-C target-cpu=x86-64-v2```/```-C target-cpu=x86-64-v3``` arguments depending on what cpu support is being targeted.)
46 Judging by the crate benchmarks, on a Ryzen 5600, compiling with SSE 4.1 (enabled in x86-64-v2 feature level) enabled can give a ~50-150% speedup, enabling the LZCNT instruction (enabled in x86-64-v3 feature level) can give a further ~50% speedup,