pub struct PasswordHashWorkFactor { /* private fields */ }Expand description
Argon2id work factor used when creating new password hashes.
Implementations§
Source§impl PasswordHashWorkFactor
impl PasswordHashWorkFactor
Sourcepub const fn rfc_9106_second_recommended() -> Self
pub const fn rfc_9106_second_recommended() -> Self
Returns the RFC 9106 second recommended Argon2id profile.
This uses 64 MiB of memory, three iterations, four lanes, and a 32-byte output.
Sourcepub fn new(
memory_kib: u32,
iterations: u32,
parallelism: u32,
output_length: usize,
) -> Result<Self>
pub fn new( memory_kib: u32, iterations: u32, parallelism: u32, output_length: usize, ) -> Result<Self>
Creates a custom Argon2id work factor.
§Errors
Returns an error when the output length or Argon2 cost parameters fall outside the ranges accepted by the Argon2 implementation.
Sourcepub const fn memory_kib(self) -> u32
pub const fn memory_kib(self) -> u32
Memory cost in KiB.
Sourcepub const fn iterations(self) -> u32
pub const fn iterations(self) -> u32
Number of Argon2 passes.
Sourcepub const fn parallelism(self) -> u32
pub const fn parallelism(self) -> u32
Number of Argon2 lanes.
Sourcepub const fn output_length(self) -> usize
pub const fn output_length(self) -> usize
Password-hash output length in bytes.
Trait Implementations§
Source§impl Clone for PasswordHashWorkFactor
impl Clone for PasswordHashWorkFactor
Source§fn clone(&self) -> PasswordHashWorkFactor
fn clone(&self) -> PasswordHashWorkFactor
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PasswordHashWorkFactor
impl Debug for PasswordHashWorkFactor
Source§impl Default for PasswordHashWorkFactor
impl Default for PasswordHashWorkFactor
Source§impl PartialEq for PasswordHashWorkFactor
impl PartialEq for PasswordHashWorkFactor
impl Copy for PasswordHashWorkFactor
impl Eq for PasswordHashWorkFactor
impl StructuralPartialEq for PasswordHashWorkFactor
Auto Trait Implementations§
impl Freeze for PasswordHashWorkFactor
impl RefUnwindSafe for PasswordHashWorkFactor
impl Send for PasswordHashWorkFactor
impl Sync for PasswordHashWorkFactor
impl Unpin for PasswordHashWorkFactor
impl UnwindSafe for PasswordHashWorkFactor
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