pub struct StrHash { /* private fields */ }Expand description
SipHash-2-4 digest of a UTF-8 string (big-endian on the wire).
Implementations§
Source§impl StrHash
impl StrHash
Sourcepub fn from_bytes(bytes: &[u8]) -> Self
pub fn from_bytes(bytes: &[u8]) -> Self
Hash raw bytes with SipHasher24 (keys k0 = 0, k1 = 0).
StrHash::new is this over UTF-8 bytes; blob ids and other
content-addressed identifiers hash raw binary payloads with it.
Sourcepub const fn from_be_bytes(hash: [u8; 16]) -> Self
pub const fn from_be_bytes(hash: [u8; 16]) -> Self
Construct from big-endian wire bytes.
Sourcepub const fn to_be_bytes(self) -> [u8; 16]
pub const fn to_be_bytes(self) -> [u8; 16]
Serialize to big-endian wire bytes.
Trait Implementations§
Source§impl Ord for StrHash
impl Ord for StrHash
Source§impl PartialOrd for StrHash
impl PartialOrd for StrHash
impl Copy for StrHash
impl Eq for StrHash
impl StructuralPartialEq for StrHash
Auto Trait Implementations§
impl Freeze for StrHash
impl RefUnwindSafe for StrHash
impl Send for StrHash
impl Sync for StrHash
impl Unpin for StrHash
impl UnsafeUnpin for StrHash
impl UnwindSafe for StrHash
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more