pub struct Params {
pub s_cost: NonZeroU32,
pub t_cost: NonZeroU32,
pub p_cost: NonZeroU32,
}Expand description
Balloon password hash parameters.
These are parameters which can be encoded into a PHC hash string.
Fields§
§s_cost: NonZeroU32Space cost, expressed in number of blocks.
t_cost: NonZeroU32Time cost, expressed in number of rounds.
p_cost: NonZeroU32Degree of parallelism, expressed in number of threads.
Only allowed to be higher than 1 when used in combination
with Algorithm::BalloonM.
Implementations§
Source§impl Params
impl Params
Sourcepub const DEFAULT_S_COST: u32 = 1024
pub const DEFAULT_S_COST: u32 = 1024
Default memory cost.
Sourcepub const DEFAULT_T_COST: u32 = 3
pub const DEFAULT_T_COST: u32 = 3
Default number of iterations (i.e. “time”).
Sourcepub const DEFAULT_P_COST: u32 = 1
pub const DEFAULT_P_COST: u32 = 1
Default degree of parallelism.
Trait Implementations§
impl Copy for Params
impl Eq for Params
impl StructuralPartialEq for Params
Source§impl<'a> TryFrom<&'a PasswordHash<'a>> for Params
Available on crate feature password-hash only.
impl<'a> TryFrom<&'a PasswordHash<'a>> for Params
Available on crate feature
password-hash only.Source§impl TryFrom<&Params> for ParamsString
Available on crate feature password-hash only.
impl TryFrom<&Params> for ParamsString
Available on crate feature
password-hash only.Auto Trait Implementations§
impl Freeze for Params
impl RefUnwindSafe for Params
impl Send for Params
impl Sync for Params
impl Unpin for Params
impl UnsafeUnpin for Params
impl UnwindSafe for Params
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<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