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
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
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
)
Performs copy-assignment from source
. Read more
Formats the value using the given formatter. Read more
This method tests for self
and other
values to be equal, and is used by ==
. Read more
This method tests for !=
.
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self | 1.21.0 [src] |
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self | 1.21.0 [src] |
Compares and returns the minimum of two values. Read more
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
Feeds this value into the given [Hasher
]. Read more
Feeds a slice of this type into the given [Hasher
]. Read more