[][src]Struct libpasta::config::DEFAULT_CONFIG

pub struct DEFAULT_CONFIG { /* fields omitted */ }

Default configuration set.

Methods from Deref<Target = Config>

#[must_use]pub fn hash_password(&self, password: &str) -> String[src]

Generates hash for a given password.

Will automatically generate a random salt. In the extreme case that the default source of randomness is unavailable, this will fallback to a seed generated when the library is initialised. An error will be logged when this happens. /// ## Panics A panic indicates a problem with the serialization mechanisms, and should be reported.

#[must_use]pub fn verify_password(&self, hash: &str, password: &str) -> bool[src]

Verifies the provided password matches the inputted hash string.

If there is any error in processing the hash or password, this will simply return false.

pub fn verify_password_update_hash(
    &self,
    hash: &str,
    password: &str
) -> HashUpdate
[src]

Verifies a supplied password against a previously computed password hash, and performs an in-place update of the hash value if the password verifies. Hence this needs to take a mutable String reference.

#[must_use]pub fn migrate_hash(&self, hash: &str) -> Option<String>[src]

Migrate the input hash to the current recommended hash.

Note that this does not require the password. This is for batch updating of hashes, where the password is not available. This performs an onion approach, returning new_hash(old_hash).

If the password is also available, the verify_password_update_hash should instead be used.

#[must_use]pub fn add_key(&self, key: &[u8]) -> String[src]

Add a new key into the list of configured keys

Trait Implementations

impl Deref for DEFAULT_CONFIG[src]

type Target = Config

The resulting type after dereferencing.

impl LazyStatic for DEFAULT_CONFIG[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.