pub enum ChecksumAlgorithm {
Blake2b512,
Md5,
Sha1,
Sha224,
Sha256,
Sha384,
Sha512,
}
Expand description
This enum represents all accepted checksum algorithms used in the Arch Linux distribution.
Variants§
Blake2b512
Blake2b-512 cryptographic hash algorithm
Md5
Md5 hash algorithm (deprecated)
Sha1
Sha1 hash algorithm (deprecated)
Sha224
Sha224 hash algorithm
Sha256
Sha256 hash algorithm
Sha384
Sha384 hash algorithm
Sha512
Sha512 hash algorithm
Implementations§
Source§impl ChecksumAlgorithm
impl ChecksumAlgorithm
Sourcepub fn is_deprecated(&self) -> bool
pub fn is_deprecated(&self) -> bool
Determines if a checksum algorithm is considered deprecated for security reasons.
Returns true
for cryptographically unsafe algorithms that should be avoided.
These algorithms are still supported for backwards compatibility but their use is strongly
discouraged.
Currently deprecated algorithms:
ChecksumAlgorithm::Md5
: Vulnerable to collision attacksChecksumAlgorithm::Sha1
: Vulnerable to collision attacks
§Examples
use alpm_types::ChecksumAlgorithm;
// Deprecated algorithms
assert!(ChecksumAlgorithm::Md5.is_deprecated());
assert!(ChecksumAlgorithm::Sha1.is_deprecated());
// Safe algorithms
assert!(!ChecksumAlgorithm::Sha256.is_deprecated());
assert!(!ChecksumAlgorithm::Blake2b512.is_deprecated());
Sourcepub fn non_deprecated_checksums(&self) -> Vec<ChecksumAlgorithm>
pub fn non_deprecated_checksums(&self) -> Vec<ChecksumAlgorithm>
Returns a list of ChecksumAlgorithm
variants that are not considered deprecated.
Trait Implementations§
Source§impl Clone for ChecksumAlgorithm
impl Clone for ChecksumAlgorithm
Source§fn clone(&self) -> ChecksumAlgorithm
fn clone(&self) -> ChecksumAlgorithm
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 ChecksumAlgorithm
impl Debug for ChecksumAlgorithm
Source§impl<'de> Deserialize<'de> for ChecksumAlgorithm
impl<'de> Deserialize<'de> for ChecksumAlgorithm
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 ChecksumAlgorithm
impl Display for ChecksumAlgorithm
Source§impl FromStr for ChecksumAlgorithm
impl FromStr for ChecksumAlgorithm
Source§impl Hash for ChecksumAlgorithm
impl Hash for ChecksumAlgorithm
Source§impl Ord for ChecksumAlgorithm
impl Ord for ChecksumAlgorithm
Source§fn cmp(&self, other: &ChecksumAlgorithm) -> Ordering
fn cmp(&self, other: &ChecksumAlgorithm) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for ChecksumAlgorithm
impl PartialEq for ChecksumAlgorithm
Source§impl PartialOrd for ChecksumAlgorithm
impl PartialOrd for ChecksumAlgorithm
Source§impl Serialize for ChecksumAlgorithm
impl Serialize for ChecksumAlgorithm
Source§impl TryFrom<&str> for ChecksumAlgorithm
impl TryFrom<&str> for ChecksumAlgorithm
Source§impl VariantNames for ChecksumAlgorithm
impl VariantNames for ChecksumAlgorithm
impl Copy for ChecksumAlgorithm
impl Eq for ChecksumAlgorithm
impl StructuralPartialEq for ChecksumAlgorithm
Auto Trait Implementations§
impl Freeze for ChecksumAlgorithm
impl RefUnwindSafe for ChecksumAlgorithm
impl Send for ChecksumAlgorithm
impl Sync for ChecksumAlgorithm
impl Unpin for ChecksumAlgorithm
impl UnwindSafe for ChecksumAlgorithm
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