Struct argonautica::input::Salt[][src]

pub struct Salt(_);

Type-safe struct representing the raw bytes of your salt

Note: A Salt knows if it's random or deterministic:

  • A Salt will be random if it's constructed via the default or random constructors. It will be deterministic if it's constructed via any of the various From implementations
  • A random Salt will generate new random bytes using a cryptographically-secure random number generator (EntropyRng) upon each call to hash, hash_raw or their non-blocking equivalents. A deterministic Salt remain constant upon each of these calls

Methods

impl Salt
[src]

Creates a new random Salt.

Initially, the random Salt has nothing in it, but every time you call hash, hash_raw, or their non-blocking equivalents on a Hasher, the Salt will update with new random bytes of the length specified generated using a cryptographically-secure random number generator (EntropyRng)

Read-only access to the underlying byte buffer

Returns true if the Salt is random; false if it is deterministic

Read-only acccess to the underlying byte buffer's length

Read-only access to the underlying byte buffer as a &str if its bytes are valid utf-8

If you have a random Salt, this method will generate new random bytes of the length of your Salt. If you have a deterministic Salt, this method does nothing

Trait Implementations

impl Default for Salt
[src]

Creates a new random Salt.

Initially, the random Salt has nothing in it, but every time you call hash, hash_raw, or their non-blocking equivalents on a Hasher, the Salt will update with 32 new random bytes generated using a cryptographically-secure random number generator (EntropyRng)

impl From<Vec<u8>> for Salt
[src]

Performs the conversion.

impl From<String> for Salt
[src]

Performs the conversion.

impl<'a> From<&'a [u8]> for Salt
[src]

Performs the conversion.

impl<'a> From<&'a str> for Salt
[src]

Performs the conversion.

impl<'a> From<&'a Vec<u8>> for Salt
[src]

Performs the conversion.

impl<'a> From<&'a String> for Salt
[src]

Performs the conversion.

impl<'a> From<&'a Salt> for Salt
[src]

Performs the conversion.

impl Clone for Salt
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for Salt
[src]

Formats the value using the given formatter. Read more

impl Eq for Salt
[src]

impl PartialEq for Salt
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Ord for Salt
[src]

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

impl PartialOrd for Salt
[src]

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl Hash for Salt
[src]

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more

Auto Trait Implementations

impl Send for Salt

impl Sync for Salt