4 releases (2 breaking)
Uses old Rust 2015
3.0.0 |
|
---|---|
2.0.0 |
|
1.0.0 |
|
0.3.0 | Apr 10, 2020 |
0.1.0 | Nov 7, 2019 |
#958 in Cryptography
Used in 5 crates
(via kelvin)
6KB
131 lines
ByteHash
Trait abstracting over hash-functions, allowing digests to be viewed as byte slices.
This allows you to use cryptographic and non-cryptographic hash functions interchangeably.
Example
use bytehash::{Blake2b, ByteHash, Wrapped};
use std::collections::hash_map::DefaultHasher;
fn main() {
let mut blake = Blake2b::default();
blake.write(b"hello world").unwrap();
let hash = blake.fin();
let mut default = Wrapped::<DefaultHasher>::default();
default.write(b"hello world").unwrap();
let hash = default.fin();
}
lib.rs
:
Trait abstracting over hash-functions, allowing digests to be viewed as byte slices.
Dependencies
~260KB