pub struct HashConfig { /* private fields */ }Implementations§
Source§impl HashConfig
Auto-generated by derive_getters::Getters.
impl HashConfig
Auto-generated by derive_getters::Getters.
Sourcepub fn memory_cost(&self) -> &u32
pub fn memory_cost(&self) -> &u32
Get field memory_cost from instance of HashConfig.
Sourcepub fn parallelism(&self) -> &u32
pub fn parallelism(&self) -> &u32
Get field parallelism from instance of HashConfig.
Source§impl HashConfig
impl HashConfig
Sourcepub fn custom(
memory_cost: u32,
time_cost: u32,
parallelism: u32,
) -> Result<Self, ConfigError>
pub fn custom( memory_cost: u32, time_cost: u32, parallelism: u32, ) -> Result<Self, ConfigError>
Creates a custom HashConfig with validated parameters.
Sourcepub fn balanced() -> Self
pub fn balanced() -> Self
Balanced preset for general production use.
- Memory: 46 MB
- Time: 1 iterations
- Parallelism: 1 threads Default recommendation according to OWASP Refer the document for best practices at different memory cost.
Sourcepub fn high_security() -> Self
pub fn high_security() -> Self
High security preset for sensitive operations.
- Memory: 64 MB
- Time: 2 iterations
- Parallelism: 4 threads Higher limits then what’s suggested in OWASP
Trait Implementations§
Source§impl Clone for HashConfig
impl Clone for HashConfig
Source§fn clone(&self) -> HashConfig
fn clone(&self) -> HashConfig
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 HashConfig
impl Debug for HashConfig
Auto Trait Implementations§
impl Freeze for HashConfig
impl RefUnwindSafe for HashConfig
impl Send for HashConfig
impl Sync for HashConfig
impl Unpin for HashConfig
impl UnwindSafe for HashConfig
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