Struct password_hash::SaltString[][src]

pub struct SaltString { /* fields omitted */ }

Owned stack-allocated equivalent of Salt.

Implementations

impl SaltString[src]

pub fn generate(rng: impl CryptoRng + RngCore) -> Self[src]

Generate a random B64-encoded SaltString.

pub fn new(s: &str) -> Result<Self>[src]

Create a new SaltString.

pub fn b64_encode(input: &[u8]) -> Result<Self>[src]

Encode the given byte slice as B64 into a new SaltString.

Returns None if the slice is too long.

pub fn b64_decode<'a>(&self, buf: &'a mut [u8]) -> Result<&'a [u8]>[src]

Decode this SaltString from B64 into the provided output buffer.

pub fn as_salt(&self) -> Salt<'_>[src]

Borrow the contents of a SaltString as a Salt.

pub fn as_str(&self) -> &str[src]

Borrow the contents of a SaltString as a str.

pub fn as_bytes(&self) -> &[u8][src]

Borrow this value as bytes.

pub fn len(&self) -> usize[src]

Get the length of this value in ASCII characters.

Trait Implementations

impl AsRef<str> for SaltString[src]

impl Clone for SaltString[src]

impl Debug for SaltString[src]

impl Eq for SaltString[src]

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

impl PartialEq<SaltString> for SaltString[src]

impl StructuralEq for SaltString[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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.