Module fog_crypto::hash [−][src]
Cryptographic hashing.
This module lets you create a cryptographic hash from a byte stream. Cryptographic hashes can
be used to uniquely identify a data sequence. They can be passed to an
IdentityKey
to be signed.
Example
// Create a new hash from raw bytes let hash = Hash::new(b"I am the entire data sequence"); println!("Hash(Base58): {}", hash); // Create a hash by feeding in bytes repeatedly let mut hash_state = HashState::new(); hash_state.update(b"I am the first part of a data sequence"); hash_state.update(b"And I am their sibling, the second part of a data sequence"); let hash = hash_state.finalize(); println!("Hash(Base58): {}", hash);
Structs
Hash | Crytographically secure hash of data. |
HashState | A hasher that can incrementally take in data and produce a hash at any time. |
Constants
DEFAULT_HASH_VERSION | Default Hash algorithm version. |
MAX_HASH_VERSION | Maximum accepted Hash algorithm version. |
MIN_HASH_VERSION | Minimum accepted Hash algorithm version. |