pub struct HashConfig { /* private fields */ }Implementations§
Source§impl HashConfig
impl HashConfig
Sourcepub fn custom(
memory_cost: u32,
time_cost: u32,
parallelism: u32,
) -> Result<Self>
pub fn custom( memory_cost: u32, time_cost: u32, parallelism: u32, ) -> Result<Self>
Creates a custom HashConfig with validated parameters.
Sourcepub fn memory_cost(&self) -> u32
pub fn memory_cost(&self) -> u32
Returns the memory cost in KiB.
Sourcepub fn parallelism(&self) -> u32
pub fn parallelism(&self) -> u32
Returns the parallelism degree.
Sourcepub fn balanced() -> Self
pub fn balanced() -> Self
Balanced preset for general production use.
- Memory: 19 MB
- Time: 2 iterations
- Parallelism: 1 thread
- Verification time: ~50ms
Sourcepub fn high_security() -> Self
pub fn high_security() -> Self
High security preset for sensitive operations.
- Memory: 64 MB
- Time: 3 iterations
- Parallelism: 4 threads
- Verification time: ~150ms
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