#[non_exhaustive]pub enum HashAlgorithm {
Sha256,
Sha384,
Sha512,
Sha3_256,
Sha3_384,
Sha3_512,
}Expand description
A hash function: SHA-2 (FIPS 180-4) or SHA-3 (FIPS 202), with its full-length output.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Sha256
SHA-256 (FIPS 180-4).
Sha384
SHA-384 (FIPS 180-4).
Sha512
SHA-512 (FIPS 180-4).
Sha3_256
SHA3-256 (FIPS 202).
Sha3_384
SHA3-384 (FIPS 202).
Sha3_512
SHA3-512 (FIPS 202).
Implementations§
Source§impl HashAlgorithm
impl HashAlgorithm
Sourcepub const ALL: &'static [HashAlgorithm]
pub const ALL: &'static [HashAlgorithm]
Every hash function.
Sourcepub const fn output_len(self) -> usize
pub const fn output_len(self) -> usize
The digest length in bytes.
Trait Implementations§
Source§impl Clone for HashAlgorithm
impl Clone for HashAlgorithm
Source§fn clone(&self) -> HashAlgorithm
fn clone(&self) -> HashAlgorithm
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for HashAlgorithm
Source§impl Debug for HashAlgorithm
impl Debug for HashAlgorithm
Source§impl Display for HashAlgorithm
impl Display for HashAlgorithm
impl Eq for HashAlgorithm
Source§impl FromStr for HashAlgorithm
impl FromStr for HashAlgorithm
Source§type Err = ParseAlgorithmError
type Err = ParseAlgorithmError
The associated error which can be returned from parsing.
Source§fn from_str(s: &str) -> Result<HashAlgorithm, <HashAlgorithm as FromStr>::Err>
fn from_str(s: &str) -> Result<HashAlgorithm, <HashAlgorithm as FromStr>::Err>
Parses a string
s to return a value of this type. Read moreSource§impl Hash for HashAlgorithm
impl Hash for HashAlgorithm
Source§impl PartialEq for HashAlgorithm
impl PartialEq for HashAlgorithm
impl StructuralPartialEq for HashAlgorithm
Auto Trait Implementations§
impl Forget for HashAlgorithm
impl Freeze for HashAlgorithm
impl Move for HashAlgorithm
impl RefUnwindSafe for HashAlgorithm
impl Send for HashAlgorithm
impl Sync for HashAlgorithm
impl Unpin for HashAlgorithm
impl UnsafeUnpin for HashAlgorithm
impl UnwindSafe for HashAlgorithm
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more