pub enum HashAlgorithm {
Sha256,
Sha512,
Sha3_256,
Sha3_512,
Blake2b256,
Blake2b512,
Blake2s256,
Blake3,
}Expand description
Hash algorithm to use for CID generation
Variants§
Sha256
SHA2-256 (default, most compatible with IPFS)
Sha512
SHA2-512 (64-byte hash for enhanced security)
Sha3_256
SHA3-256 (Keccak-based, secure)
Sha3_512
SHA3-512 (Keccak-based, 64-byte hash)
Blake2b256
BLAKE2b-256 (fast, 32-byte hash, optimized for 64-bit)
Blake2b512
BLAKE2b-512 (fast, 64-byte hash, maximum security)
Blake2s256
BLAKE2s-256 (fast, 32-byte hash, optimized for 8-32 bit)
Blake3
BLAKE3 (fastest, 32-byte hash, modern cryptographic design)
Implementations§
Source§impl HashAlgorithm
impl HashAlgorithm
Sourcepub const fn is_256_bit(&self) -> bool
pub const fn is_256_bit(&self) -> bool
Check if this algorithm produces a 32-byte (256-bit) hash
Sourcepub const fn is_512_bit(&self) -> bool
pub const fn is_512_bit(&self) -> bool
Check if this algorithm produces a 64-byte (512-bit) hash
Sourcepub fn has_simd_support(&self) -> bool
pub fn has_simd_support(&self) -> bool
Check if this algorithm has SIMD support on the current platform
Sourcepub fn all() -> &'static [HashAlgorithm]
pub fn all() -> &'static [HashAlgorithm]
Get all available hash algorithms
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§fn default() -> HashAlgorithm
fn default() -> HashAlgorithm
Returns the “default value” for a type. Read more
Source§impl Display for HashAlgorithm
impl Display for HashAlgorithm
Source§impl FromStr for HashAlgorithm
impl FromStr 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
Mutably borrows from an owned value. Read more
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more