pub enum HashAlgorithm {
SHA256,
SHA3_256,
BLAKE3,
}Expand description
Supported hashing algorithms for checksum verification
Variants§
SHA256
SHA-256 (most widely supported)
SHA3_256
SHA3-256 (newer, more secure)
BLAKE3
BLAKE3 (fastest, most modern)
Implementations§
Source§impl HashAlgorithm
impl HashAlgorithm
Sourcepub fn hash_length(&self) -> usize
pub fn hash_length(&self) -> usize
Get the expected length of the hash in bytes
Sourcepub fn hex_length(&self) -> usize
pub fn hex_length(&self) -> usize
Get the expected length of the hash in hexadecimal characters
Sourcepub fn validate_hash_format(&self, hash: &str) -> Result<()>
pub fn validate_hash_format(&self, hash: &str) -> Result<()>
Validate that a hash string has the correct length for this algorithm
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 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HashAlgorithm
impl Debug for HashAlgorithm
Source§impl Default for HashAlgorithm
impl Default for HashAlgorithm
Source§impl<'de> Deserialize<'de> for HashAlgorithm
impl<'de> Deserialize<'de> for HashAlgorithm
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for HashAlgorithm
impl Display for HashAlgorithm
Source§impl FromStr for HashAlgorithm
impl FromStr for HashAlgorithm
Source§impl Hash for HashAlgorithm
impl Hash for HashAlgorithm
Source§impl PartialEq for HashAlgorithm
impl PartialEq for HashAlgorithm
Source§impl Serialize for HashAlgorithm
impl Serialize 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
Mutably borrows from an owned value. Read more