Expand description
Provides traits Hash
, HashStream
, and HashTryStream
for SHA-2 hashing data
which must be accessed asynchronously, e.g. a Stream
or database table.
Hash
is implemented for standard Rust types:
- Primitive types:
- bool
- i8, i16, i32, i64, i128, isize
- u8, u16, u32, u64, u128, usize
- f32, f64
- &str
- String
- Common standard library types:
- Option<T>
- PhantomData<T>
- Compound types:
- [T; 0] through [T; 32]
- tuples up to size 16
- Collection types:
- BTreeMap<K, V>
- BTreeSet<T>
- BinaryHeap<T>
- LinkedList<T>
- VecDeque<T>
- Vec<T>
- Other types:
- SmallVec<V> (requires the
smallvec
feature flag)
- SmallVec<V> (requires the
IMPORTANT: hashing is order-dependent. Do not implement the traits in this crate for
any data structure which does not have a consistent order. Consider using the collate
crate
if you need to use a type which does not implement Ord
.
Re-exports§
pub use sha2::digest::generic_array;
Traits§
- Digest
- Convenience wrapper trait covering functionality of cryptographic hash functions with fixed output size.
- Hash
- Trait to compute a SHA-2 hash using the digest type
D
Functions§
- default_
hash - Construct an empty hash
- hash_
stream - Hash a
Stream
- hash_
try_ stream - Hash a
TryStream
Type Aliases§
- Output
- Output array of
OutputSizeUser
implementors. - Sha256
- SHA-256 hasher.