#[non_exhaustive]pub enum Algorithm {
Sha512,
Sha384,
Sha256,
Sha1,
Xxh3,
}
Expand description
Valid algorithms for integrity strings.
Sha1
and Xxh3
are special cases in this library–they’re not allowed by the
current SRI spec, but they’re useful enough that having first-class support
makes sense. They should also be completely harmless to have in your strings
if you do use it in a browser context–they just won’t be used.
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.
Sha512
Sha384
Sha256
Sha1
Xxh3
xxh3 is a non-cryptographic hash function that is very fast and can be used to speed up integrity calculations, at the cost of cryptographically-secure guarantees.
ssri
uses 128-bit xxh3 hashes, which have been shown to have no
conflicts even on billions of hashes.
Trait Implementations§
source§impl Ord for Algorithm
impl Ord for Algorithm
source§impl PartialEq for Algorithm
impl PartialEq for Algorithm
source§impl PartialOrd for Algorithm
impl PartialOrd for Algorithm
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for Algorithm
impl Eq for Algorithm
impl StructuralPartialEq for Algorithm
Auto Trait Implementations§
impl RefUnwindSafe for Algorithm
impl Send for Algorithm
impl Sync for Algorithm
impl Unpin 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
Mutably borrows from an owned value. Read more