Trait argon2::PasswordHasher[][src]

pub trait PasswordHasher {
    type Params: Clone + Debug + Default + for<'a> TryFrom<&'a PasswordHash<'a>> + TryInto<ParamsString>;
    pub fn hash_password<'a>(
        &self,
        password: &[u8],
        algorithm: Option<Ident<'a>>,
        params: Self::Params,
        salt: impl Into<Salt<'a>>
    ) -> Result<PasswordHash<'a>, Error>; pub fn hash_password_simple<S>(
        &self,
        password: &[u8],
        salt: &'a S
    ) -> Result<PasswordHash<'a>, Error>
    where
        S: AsRef<str> + ?Sized
, { ... } }
This is supported on crate feature password-hash only.

Trait for password hashing functions.

Associated Types

type Params: Clone + Debug + Default + for<'a> TryFrom<&'a PasswordHash<'a>> + TryInto<ParamsString>[src]

Algorithm-specific parameters.

Loading content...

Required methods

pub fn hash_password<'a>(
    &self,
    password: &[u8],
    algorithm: Option<Ident<'a>>,
    params: Self::Params,
    salt: impl Into<Salt<'a>>
) -> Result<PasswordHash<'a>, Error>
[src]

Compute a PasswordHash with the given algorithm Ident (or None for the recommended default), password, salt, and parameters.

Loading content...

Provided methods

pub fn hash_password_simple<S>(
    &self,
    password: &[u8],
    salt: &'a S
) -> Result<PasswordHash<'a>, Error> where
    S: AsRef<str> + ?Sized
[src]

Simple API for computing a PasswordHash from a password and Salt value.

Uses the default recommended parameters for a given algorithm.

Loading content...

Implementors

impl PasswordHasher for Argon2<'_>[src]

type Params = Params

Loading content...