pub struct Config<'a> {
pub ad: &'a [u8],
pub hash_length: u32,
pub lanes: u32,
pub mem_cost: u32,
pub secret: &'a [u8],
pub time_cost: u32,
pub variant: Variant,
pub version: Version,
}
Expand description
Structure containing configuration settings.
Examples
use argon2::{Config, Variant, Version};
let config = Config::default();
assert_eq!(config.ad, &[]);
assert_eq!(config.hash_length, 32);
assert_eq!(config.lanes, 1);
assert_eq!(config.mem_cost, 19 * 1024);
assert_eq!(config.secret, &[]);
assert_eq!(config.time_cost, 2);
assert_eq!(config.variant, Variant::Argon2id);
assert_eq!(config.version, Version::Version13);
Fields§
§ad: &'a [u8]
The associated data.
hash_length: u32
The length of the resulting hash.
lanes: u32
The number of lanes.
mem_cost: u32
The amount of memory requested (KB).
secret: &'a [u8]
The key.
time_cost: u32
The number of passes.
variant: Variant
The variant.
version: Version
The version number.
Implementations§
Trait Implementations§
source§impl<'a> PartialEq<Config<'a>> for Config<'a>
impl<'a> PartialEq<Config<'a>> for Config<'a>
impl<'a> StructuralPartialEq for Config<'a>
Auto Trait Implementations§
impl<'a> RefUnwindSafe for Config<'a>
impl<'a> Send for Config<'a>
impl<'a> Sync for Config<'a>
impl<'a> Unpin for Config<'a>
impl<'a> UnwindSafe for Config<'a>
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