[−][src]Struct ssb_crypto::Hash
A sha256 hash digest. The standard hash in the scuttleverse.
Implementations
impl Hash[src]
pub const SIZE: usize[src]
The size in bytes of the Hash type ( == 32).
pub fn from_slice(s: &[u8]) -> Option<Self>[src]
Deserialize from byte representation.
Returns None if the slice length isn't 32.
Note that this doesn't hash the provided byte slice,
use the hash function for that.
pub fn from_base64(s: &str) -> Option<Self>[src]
Deserialize from base-64 string representation. Ignores optional leading '%' or '&' sigil and '.sha256' suffix.
Example
let s = "%4hUgS4j0TwKdsZzOV/tfqiPtqoLw2qYg/Wl9Xy8FPEU=.sha256"; let h = ssb_crypto::Hash::from_base64(s).unwrap();
Trait Implementations
impl AsBytes for Hash[src]
fn only_derive_is_allowed_to_implement_this_trait() where
Self: Sized, [src]
Self: Sized,
fn as_bytes(&self) -> &[u8][src]
fn as_bytes_mut(&mut self) -> &mut [u8] where
Self: FromBytes, [src]
Self: FromBytes,
impl Debug for Hash[src]
impl FromBytes for Hash[src]
fn only_derive_is_allowed_to_implement_this_trait() where
Self: Sized, [src]
Self: Sized,
impl PartialEq<Hash> for Hash[src]
impl StructuralPartialEq for Hash[src]
Auto Trait Implementations
impl RefUnwindSafe for Hash
impl Send for Hash
impl Sync for Hash
impl Unpin for Hash
impl UnwindSafe for Hash
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
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> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
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<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,