[−][src]Enum phc::Salt
Salt value used in hashing.
Variants
Ascii(String)
A string with characters in the range [a-zA-Z0-9/+.-].
A binary value encoded as Base64.
Methods
impl Salt
[src]
pub fn into_binary(self) -> Salt
[src]
Returns a version of this salt interpreted as binary.
Examples
use phc::Salt; let salt = Salt::from("c29tZSBzYWx0"); assert_eq!(salt.into_binary(), Salt::from(b"some salt"));
If the salt is invalid ascii, it's returned without change.
use phc::Salt; let salt = Salt::from("Not salt!"); assert_eq!(salt.clone().into_binary(), salt);
Trait Implementations
impl From<String> for Salt
[src]
impl<'_> From<&'_ str> for Salt
[src]
impl From<Vec<u8>> for Salt
[src]
impl<'_> From<&'_ [u8]> for Salt
[src]
impl<'_> From<&'_ [u8; 0]> for Salt
[src]
impl From<[u8; 0]> for Salt
[src]
impl<'_> From<&'_ [u8; 1]> for Salt
[src]
impl From<[u8; 1]> for Salt
[src]
impl<'_> From<&'_ [u8; 2]> for Salt
[src]
impl From<[u8; 2]> for Salt
[src]
impl<'_> From<&'_ [u8; 3]> for Salt
[src]
impl From<[u8; 3]> for Salt
[src]
impl<'_> From<&'_ [u8; 4]> for Salt
[src]
impl From<[u8; 4]> for Salt
[src]
impl<'_> From<&'_ [u8; 5]> for Salt
[src]
impl From<[u8; 5]> for Salt
[src]
impl<'_> From<&'_ [u8; 6]> for Salt
[src]
impl From<[u8; 6]> for Salt
[src]
impl<'_> From<&'_ [u8; 7]> for Salt
[src]
impl From<[u8; 7]> for Salt
[src]
impl<'_> From<&'_ [u8; 8]> for Salt
[src]
impl From<[u8; 8]> for Salt
[src]
impl<'_> From<&'_ [u8; 9]> for Salt
[src]
impl From<[u8; 9]> for Salt
[src]
impl<'_> From<&'_ [u8; 10]> for Salt
[src]
impl From<[u8; 10]> for Salt
[src]
impl<'_> From<&'_ [u8; 11]> for Salt
[src]
impl From<[u8; 11]> for Salt
[src]
impl<'_> From<&'_ [u8; 12]> for Salt
[src]
impl From<[u8; 12]> for Salt
[src]
impl<'_> From<&'_ [u8; 13]> for Salt
[src]
impl From<[u8; 13]> for Salt
[src]
impl<'_> From<&'_ [u8; 14]> for Salt
[src]
impl From<[u8; 14]> for Salt
[src]
impl<'_> From<&'_ [u8; 15]> for Salt
[src]
impl From<[u8; 15]> for Salt
[src]
impl<'_> From<&'_ [u8; 16]> for Salt
[src]
impl From<[u8; 16]> for Salt
[src]
impl Clone for Salt
[src]
impl PartialEq<Salt> for Salt
[src]
impl Debug for Salt
[src]
impl Display for Salt
[src]
impl StructuralPartialEq for Salt
[src]
Auto Trait Implementations
impl Send for Salt
impl Sync for Salt
impl Unpin for Salt
impl UnwindSafe for Salt
impl RefUnwindSafe for Salt
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,