pub struct PasswordHashConfig {
pub mem_cost: u32,
pub time_cost: u32,
pub lanes: u32,
pub hash_length: usize,
}Expand description
Configuration for Argon2 password hashing parameters.
Fields§
§mem_cost: u32Memory cost in kibibytes (1 KiB = 1024 bytes). Higher values increase resistance to brute-force attacks. Recommended: at least 65536 (64 MiB) in production environments.
time_cost: u32Number of iterations (aka time cost). Higher values increase CPU effort. Recommended: at least 3 for most applications.
lanes: u32Degree of parallelism (number of threads/lanes to use). Usually matches the number of CPU cores available.
hash_length: usizeDesired length of the resulting password hash in bytes. Common values are 32 (256 bits) or 64 (512 bits).
Trait Implementations§
Source§impl Clone for PasswordHashConfig
impl Clone for PasswordHashConfig
Source§fn clone(&self) -> PasswordHashConfig
fn clone(&self) -> PasswordHashConfig
Returns a copy 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 moreAuto Trait Implementations§
impl Freeze for PasswordHashConfig
impl RefUnwindSafe for PasswordHashConfig
impl Send for PasswordHashConfig
impl Sync for PasswordHashConfig
impl Unpin for PasswordHashConfig
impl UnwindSafe for PasswordHashConfig
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