[][src]Struct meowhash::MeowHash

pub struct MeowHash { /* fields omitted */ }

A hash produced by the MeowHasher.

It consists of 8 128-bit SIMD register values, 128 bytes in total. You can distill it into a u128 or use the entire 128 byte hash.

It's recommended to keep the MeowHash instead of converting it into an array of bytes, because MeowHashes can be compared efficiently using SIMD instructions where byte arrays may need a byte by byte comparison.

Methods

impl MeowHash[src]

pub fn from_bytes(bytes: [u8; 128]) -> Self[src]

Create a MeowHash from an array of 128 bytes.

pub fn from_slice(bytes: &[u8]) -> Option<Self>[src]

Attempt to construct a MeowHash from a slice of bytes.

This will fail if the slice doesn't contain exactly 128 bytes.

pub fn into_bytes(self) -> [u8; 128][src]

Convert a MeowHash into an array of 128 bytes.

pub fn as_u128(&self) -> u128[src]

Compress a MeowHash into a u128.

pub fn expand_seed(seed: &[u8]) -> Self[src]

Construct a seed value from arbitrary length input data.

This can be an expensive operation, so try to only do it once.

pub fn default_seed() -> Self[src]

Create a MeowHash containing the default seed (an encoding of pi).

Trait Implementations

impl Clone for MeowHash[src]

impl Copy for MeowHash[src]

impl Debug for MeowHash[src]

impl Eq for MeowHash[src]

impl From<[u8; 128]> for MeowHash[src]

impl From<GenericArray<u8, UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>> for MeowHash[src]

impl Into<[u8; 128]> for MeowHash[src]

impl Into<GenericArray<u8, UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>> for MeowHash[src]

impl Into<u128> for MeowHash[src]

impl PartialEq<MeowHash> for MeowHash[src]

Auto Trait Implementations

impl Send for MeowHash

impl Sync for MeowHash

impl Unpin for MeowHash

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> Same<T> for T

type Output = T

Should always be Self

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.