[][src]Enum pgp::crypto::hash::HashAlgorithm

#[repr(u8)]
pub enum HashAlgorithm {
    None,
    MD5,
    SHA1,
    RIPEMD160,
    SHA2_256,
    SHA2_384,
    SHA2_512,
    SHA2_224,
    SHA3_256,
    SHA3_512,
    Private10,
}

Available hash algorithms. Ref: https://tools.ietf.org/html/rfc4880.html#section-9.4

Variants

None
MD5
SHA1
RIPEMD160
SHA2_256
SHA2_384
SHA2_512
SHA2_224
SHA3_256
SHA3_512
Private10

Do not use, just for compatability with GnuPG.

Methods

impl HashAlgorithm[src]

pub fn new_hasher(self) -> Result<Box<dyn Hasher>>[src]

Create a new hasher.

pub fn digest(self, data: &[u8]) -> Result<Vec<u8>>[src]

Calculate the digest of the given input data.

pub fn digest_size(self) -> usize[src]

Returns the expected digest size for the given algorithm.

Trait Implementations

impl Clone for HashAlgorithm[src]

impl Copy for HashAlgorithm[src]

impl Default for HashAlgorithm[src]

impl Eq for HashAlgorithm[src]

impl PartialEq<HashAlgorithm> for HashAlgorithm[src]

impl Debug for HashAlgorithm[src]

impl FromPrimitive for HashAlgorithm[src]

impl DefaultIsZeroes for HashAlgorithm[src]

impl TryInto<Hashes> for HashAlgorithm[src]

type Err = Error

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> Clear for T where
    T: InitializableFromZeroed + ?Sized
[src]

impl<T> InitializableFromZeroed for T where
    T: Default
[src]

impl<Z> Zeroize for Z where
    Z: DefaultIsZeroes
[src]

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Err = <U as TryFrom<T>>::Err