Enum xvc_core::types::hashalgorithm::HashAlgorithm
source · pub enum HashAlgorithm {
AsIs,
Blake3,
Blake2s,
SHA2_256,
SHA3_256,
}Expand description
The available content hash algorithms to get content addresses. Note that, the selection is based on the digest size being 32 bytes. We already represent this as 64 digit hex in the file hierarchies. Using a longer digests than 32 bytes will probably cause file length problems, especially in Windows.
The default algorithm is set by cache.algorithm config key.
See crate::XvcDigest for details of digest calculation.
Variants§
AsIs
Do nothing. When the data to be hashed is already less than 32 bytes, it’s used as is. Please do not use this in your functions. This is currently only used to prevent crate::XvcMetadata to be hashed in xvc_ecs::HStore
Blake3
Use BLAKE3 to calculate digests: https://github.com/BLAKE3-team/BLAKE3 This is the default
Blake2s
Use BLAKE2S to calculate digests: https://www.blake2.net
SHA2_256
Use SHA2-256 to calculate digests. https://en.wikipedia.org/wiki/SHA-2 This may be used when FIPS/NIST compatibility is required.
SHA3_256
Use SHA2-256 to calculate digests: https://en.wikipedia.org/wiki/SHA-3 This may be used when NIST compatibility is required.
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<'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>,
source§impl Display for HashAlgorithm
impl Display for HashAlgorithm
source§impl FromConfigKey<HashAlgorithm> for HashAlgorithm
impl FromConfigKey<HashAlgorithm> for HashAlgorithm
source§fn from_conf(conf: &XvcConfig) -> HashAlgorithm
fn from_conf(conf: &XvcConfig) -> HashAlgorithm
T from configuration.
Supposed to panic! if there is no key, or the value cannot be parsed.source§fn try_from_conf(conf: &XvcConfig) -> Result<HashAlgorithm>
fn try_from_conf(conf: &XvcConfig) -> Result<HashAlgorithm>
T from the configuration.
Returns error if there is no key, or the value cannot be parsed.source§impl FromStr for HashAlgorithm
impl FromStr for HashAlgorithm
source§impl Ord for HashAlgorithm
impl Ord for HashAlgorithm
source§fn cmp(&self, other: &HashAlgorithm) -> Ordering
fn cmp(&self, other: &HashAlgorithm) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
source§impl PartialEq<HashAlgorithm> for HashAlgorithm
impl PartialEq<HashAlgorithm> for HashAlgorithm
source§fn eq(&self, other: &HashAlgorithm) -> bool
fn eq(&self, other: &HashAlgorithm) -> bool
self and other values to be equal, and is used
by ==.source§impl PartialOrd<HashAlgorithm> for HashAlgorithm
impl PartialOrd<HashAlgorithm> for HashAlgorithm
source§fn partial_cmp(&self, other: &HashAlgorithm) -> Option<Ordering>
fn partial_cmp(&self, other: &HashAlgorithm) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self and other) and is used by the <=
operator. Read moresource§impl Serialize for HashAlgorithm
impl Serialize for HashAlgorithm
source§impl TryFrom<&str> for HashAlgorithm
impl TryFrom<&str> for HashAlgorithm
source§impl VariantNames for HashAlgorithm
impl VariantNames for HashAlgorithm
impl Copy for HashAlgorithm
impl Eq for HashAlgorithm
impl StructuralEq for HashAlgorithm
impl StructuralPartialEq for HashAlgorithm
Auto Trait Implementations§
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
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.