Trait password_hash::PasswordHasher[][src]

pub trait PasswordHasher {
    type Params: Clone + Debug + Default + for<'a> TryFrom<&'a ParamsString, Error = HasherError> + for<'a> TryInto<ParamsString, Error = HasherError>;
    fn hash_password<'a>(
        &self,
        password: &[u8],
        algorithm: Option<Ident<'a>>,
        version: Option<Decimal>,
        params: Self::Params,
        salt: Salt<'a>
    ) -> Result<PasswordHash<'a>, HasherError>; fn hash_password_simple<'a>(
        &self,
        password: &[u8],
        salt: &'a str
    ) -> Result<PasswordHash<'a>, HasherError> { ... } }

Trait for password hashing functions.

Associated Types

type Params: Clone + Debug + Default + for<'a> TryFrom<&'a ParamsString, Error = HasherError> + for<'a> TryInto<ParamsString, Error = HasherError>[src]

Algorithm-specific parameters.

Loading content...

Required methods

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

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

Loading content...

Provided methods

fn hash_password_simple<'a>(
    &self,
    password: &[u8],
    salt: &'a str
) -> Result<PasswordHash<'a>, HasherError>
[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

Loading content...