pub struct Params { /* private fields */ }
Expand description
The Scrypt parameter values.
Implementations
sourceimpl Params
impl Params
sourcepub fn new(log_n: u8, r: u32, p: u32) -> Result<Params, InvalidParams>
pub fn new(log_n: u8, r: u32, p: u32) -> Result<Params, InvalidParams>
Create a new instance of ScryptParams.
Arguments
log_n
- The log2 of the Scrypt parameterN
r
- The Scrypt parameterr
p
- The Scrypt parameterp
Conditions
log_n
must be less than64
r
must be greater than0
and less than or equal to4294967295
p
must be greater than0
and less than4294967295
sourcepub fn recommended() -> Params
pub fn recommended() -> Params
Recommended values sufficient for most use-cases
log_n = 15
(n = 32768
)r = 8
p = 1
sourcepub fn log_n(&self) -> u8
pub fn log_n(&self) -> u8
log2 of the Scrypt parameter N
, the work factor.
Memory and CPU usage scale linearly with N
.
Trait Implementations
sourceimpl<'a> TryFrom<&'a PasswordHash<'a>> for Params
This is supported on crate feature simple
only.
impl<'a> TryFrom<&'a PasswordHash<'a>> for Params
This is supported on crate feature
simple
only.sourceimpl<'a> TryFrom<Params> for ParamsString
This is supported on crate feature simple
only.
impl<'a> TryFrom<Params> for ParamsString
This is supported on crate feature
simple
only.impl Copy for Params
Auto Trait Implementations
impl RefUnwindSafe for Params
impl Send for Params
impl Sync for Params
impl Unpin for Params
impl UnwindSafe for Params
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more