pub enum HashAlgorithm {
Sha1,
Sha256,
Sha384,
Sha512,
Md5,
Keccak,
}Expand description
Supported cryptographic hash algorithms.
§Security Warning
MD5 and SHA-1 are deprecated due to known cryptographic vulnerabilities. Use Sha256 or stronger algorithms for new implementations. The deprecated variants are maintained only for backward compatibility with legacy exchanges that still require them.
Variants§
Sha1
SHA-1 hash algorithm
§Security Warning
DEPRECATED - SHA-1 has been cryptographically broken since 2017. Collision attacks are practical. Do NOT use for new implementations. Use Sha256 instead.
Sha256
SHA-256 hash algorithm (recommended)
Sha384
SHA-384 hash algorithm
Sha512
SHA-512 hash algorithm
Md5
MD5 hash algorithm
§Security Warning
DEPRECATED - MD5 has been cryptographically broken since 2004. Collision attacks are practical. Do NOT use for new implementations. Use Sha256 instead.
Keccak
Keccak-256 (SHA-3) hash algorithm
Implementations§
Source§impl HashAlgorithm
impl HashAlgorithm
Sourcepub fn from_str(s: &str) -> Result<HashAlgorithm, Error>
pub fn from_str(s: &str) -> Result<HashAlgorithm, Error>
Parses a hash algorithm from a string.
§Arguments
s- Algorithm name (case-insensitive)
§Returns
Parsed HashAlgorithm or error if unsupported.
Trait Implementations§
Source§impl Clone for HashAlgorithm
impl Clone for HashAlgorithm
Source§fn clone(&self) -> HashAlgorithm
fn clone(&self) -> HashAlgorithm
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for HashAlgorithm
impl Debug for HashAlgorithm
Source§impl Display for HashAlgorithm
impl Display for HashAlgorithm
Source§impl PartialEq for HashAlgorithm
impl PartialEq for HashAlgorithm
impl Copy for HashAlgorithm
impl Eq for HashAlgorithm
impl StructuralPartialEq for HashAlgorithm
Auto Trait Implementations§
impl Freeze for HashAlgorithm
impl RefUnwindSafe for HashAlgorithm
impl Send for HashAlgorithm
impl Sync for HashAlgorithm
impl Unpin 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.