#[non_exhaustive]pub enum Digest {
Sha256,
Sha384,
Sha512,
Sha1,
}Expand description
The algorithm a PeerId is made with: the <alg> of its <alg>:<hash> text.
Sha256 is the id of a peer by default. The others exist so a pin written
elsewhere can be read; whether a method accepts them is its own allow-list (a list of
Digest values). MD5 is not supported at all. Methods whose keys are named by another
algorithm add variants here, which is why the enum is non-exhaustive.
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.
Sha256
SHA-256, 32 bytes. The default and the only digest of an identity.
Sha384
SHA-384, 48 bytes.
Sha512
SHA-512, 64 bytes.
Sha1
SHA-1, 20 bytes. Legacy interoperability only.
Implementations§
Trait Implementations§
impl Copy for Digest
Source§impl<'de> Deserialize<'de> for Digest
Available on crate feature serde only.
impl<'de> Deserialize<'de> for Digest
Available on crate feature
serde only.Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Digest
Source§impl Ord for Digest
impl Ord for Digest
1.21.0 (const: unstable) · 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
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for Digest
impl PartialOrd for Digest
impl StructuralPartialEq for Digest
Auto Trait Implementations§
impl Freeze for Digest
impl RefUnwindSafe for Digest
impl Send for Digest
impl Sync for Digest
impl Unpin for Digest
impl UnsafeUnpin for Digest
impl UnwindSafe for Digest
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