#[repr(C)]
pub struct Hash(pub [u8; 32]);
Expand description
A sha256 hash digest. The standard hash in the scuttleverse.
The size in bytes of the Hash type ( == 32).
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.
Deserialize from base-64 string representation.
Ignores optional leading ‘%’ or ‘&’ sigil and ‘.sha256’ suffix.
let s = "%4hUgS4j0TwKdsZzOV/tfqiPtqoLw2qYg/Wl9Xy8FPEU=.sha256";
let h = ssb_crypto::Hash::from_base64(s).unwrap();
Does not include “.sha256” suffix or a sigil prefix.
let s = "4hUgS4j0TwKdsZzOV/tfqiPtqoLw2qYg/Wl9Xy8FPEU=";
let h = ssb_crypto::Hash::from_base64(s).unwrap();
assert_eq!(h.as_base64(), s);
Get the bytes of this value mutably. 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 !=
.
impl<T> Any for T where
T: 'static + ?Sized,
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
impl<T, U> Into<U> for T where
U: From<T>,
The type returned in the event of a conversion error.
The type returned in the event of a conversion error.
impl<V, T> VZip<V> for T where
V: MultiLane<T>,