pub struct Argon2 {
pub m_cost: u32,
pub t_cost: u32,
pub p_cost: u32,
pub hash_length: u64,
pub algorithm: Algorithm,
pub version: Version,
}Expand description
Argon2 instance
Fields§
§m_cost: u32§t_cost: u32§p_cost: u32§hash_length: u64§algorithm: AlgorithmBy default we use the Argon2id
version: VersionBy default we use the version 0x13
Implementations§
Source§impl Argon2
impl Argon2
pub fn new(m_cost: u32, t_cost: u32, p_cost: u32) -> Self
pub fn with_algorithm(self, algorithm: Algorithm) -> Self
pub fn with_version(self, version: Version) -> Self
pub fn with_hash_length(self, hash_length: u64) -> Self
Sourcepub fn hash_password(
&self,
password: &SecureString,
salt: Vec<u8>,
) -> Result<SecureBytes, Error>
pub fn hash_password( &self, password: &SecureString, salt: Vec<u8>, ) -> Result<SecureBytes, Error>
Trait Implementations§
Source§impl<'__de, __Context> BorrowDecode<'__de, __Context> for Argon2
impl<'__de, __Context> BorrowDecode<'__de, __Context> for Argon2
Source§fn borrow_decode<__D: BorrowDecoder<'__de, Context = __Context>>(
decoder: &mut __D,
) -> Result<Self, DecodeError>
fn borrow_decode<__D: BorrowDecoder<'__de, Context = __Context>>( decoder: &mut __D, ) -> Result<Self, DecodeError>
Attempt to decode this type with the given BorrowDecode.
Auto Trait Implementations§
impl Freeze for Argon2
impl RefUnwindSafe for Argon2
impl Send for Argon2
impl Sync for Argon2
impl Unpin for Argon2
impl UnwindSafe for Argon2
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