Struct orion::kdf::Salt

source ·
pub struct Salt { /* private fields */ }
Expand description

A type to represent the Salt that PBKDF2 uses during key derivation.

As default it will randomly generate a Salt of 64 bytes.

Note:

Due to the return type of the Default trait, the default() method cannot let the caller handle a failing CSPRNG. If the CSPRNG fails, that function panics. If handling a failing CSPRNG’s error is needed, use instead generate().

Exceptions:

An exception will be thrown if:

  • slice is empty.
  • The OsRng fails to initialize or read from its source.
  • length is 0.
  • length is not less than u32::max_value().

Implementations§

Make an object from a given byte slice.

Return the object as byte slice.

Return the length of the object.

Randomly generate using a CSPRNG. Not available in no_std context.

Trait Implementations§

Formats the value using the given formatter. Read more

Randomly generate using a CSPRNG with recommended size. Not available in no_std context.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Completely overwrites this value.

Returns the argument unchanged.

Called to initialize a place to a valid value, after it is set to all-bits-zero. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.