pub enum Algorithm {
Show 15 variants
Md5,
Sha1,
Sha224,
Sha256,
Sha384,
Sha512,
Sha3_224,
Sha3_256,
Sha3_384,
Sha3_512,
Blake2b512,
Blake2s256,
Blake3,
Xxh3,
Xxh128,
}Expand description
Stable identifier for every algorithm understood by QuicHash.
Variants§
Md5
MD5 with a 128-bit output.
Sha1
SHA-1 with a 160-bit output.
Sha224
SHA-224 from the SHA-2 family.
Sha256
SHA-256 from the SHA-2 family.
Sha384
SHA-384 from the SHA-2 family.
Sha512
SHA-512 from the SHA-2 family.
Sha3_224
SHA3-224.
Sha3_256
SHA3-256.
Sha3_384
SHA3-384.
Sha3_512
SHA3-512.
Blake2b512
BLAKE2b with a 512-bit output.
Blake2s256
BLAKE2s with a 256-bit output.
Blake3
BLAKE3 with its standard 256-bit output.
Xxh3
XXH3 with a 64-bit output.
Xxh128
XXH3 with a 128-bit output.
Implementations§
Source§impl Algorithm
impl Algorithm
Sourcepub const ALL: [Self; 15]
pub const ALL: [Self; 15]
Every algorithm identifier understood by this version of the crate.
The array includes algorithms that may have been disabled through Cargo
features. Use Algorithm::is_available to filter it.
Sourcepub const fn canonical_name(self) -> &'static str
pub const fn canonical_name(self) -> &'static str
Return the stable lowercase name used in manifests and string parsing.
Sourcepub const fn display_name(self) -> &'static str
pub const fn display_name(self) -> &'static str
Return a human-readable algorithm name.
Sourcepub const fn output_size(self) -> usize
pub const fn output_size(self) -> usize
Return the digest size in bytes.
Sourcepub const fn required_feature(self) -> &'static str
pub const fn required_feature(self) -> &'static str
Return the Cargo feature that provides this implementation.
Sourcepub const fn is_available(self) -> bool
pub const fn is_available(self) -> bool
Return whether this algorithm was compiled into the current build.
Sourcepub fn hasher(self) -> Result<Box<dyn Hasher>, HashUtilityError>
pub fn hasher(self) -> Result<Box<dyn Hasher>, HashUtilityError>
Construct a fresh streaming hasher for this algorithm.
Returns HashUtilityError::AlgorithmUnavailable when the corresponding
Cargo feature is disabled.
Trait Implementations§
impl Copy for Algorithm
impl Eq for Algorithm
Source§impl Ord for Algorithm
impl Ord for Algorithm
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialOrd for Algorithm
impl PartialOrd for Algorithm
impl StructuralPartialEq for Algorithm
Auto Trait Implementations§
impl Freeze for Algorithm
impl RefUnwindSafe for Algorithm
impl Send for Algorithm
impl Sync for Algorithm
impl Unpin for Algorithm
impl UnsafeUnpin for Algorithm
impl UnwindSafe for Algorithm
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more