3 unstable releases
new 0.3.0 | Jun 1, 2023 |
---|---|
0.2.2 | Mar 18, 2023 |
0.2.1 | Jan 2, 2023 |
0.1.0-rc3 |
|
#292 in Cryptography
37 downloads per month
Used in 2 crates
410KB
7K
SLoC
chksum-hash
A simple cryptography library that provides an interface for calculating hash digests using both batch and stream computation.
Features
- Written in pure Rust,
- No unsafe code
- Configurable via Cargo features
- Can be built without any dependencies
Setup
Add the following entry to the dependencies
section of your Cargo.toml
file:
[dependencies]
# ...
chksum-hash = "0.3.0"
Alternatively, you can use the cargo add
subcommand:
cargo add chksum-hash
Usage
use chksum_hash as hash;
let digest = hash::new(hash::SHA2_256)
.update("some")
.update(b"data")
.update([0, 1, 2, 3])
.digest();
assert_eq!(
digest.to_hex_lowercase(),
"5c3bfbc8614adc72d3ec0e9b15a1fd1c55cee63e34af5a4ff058eb2eef7d8482"
);
For more usage examples, refer to the documentation available at docs.rs.
License
MIT
Dependencies
~0.5–3.5MB
~67K SLoC