Struct SipHasher
Deprecated since 1.13.0: use `std::hash::DefaultHasher` instead
pub struct SipHasher(pub(in ::hash::sip) SipHasher24);
An implementation of SipHash 2-4.
See: https://github.com/veorq/SipHash
SipHash is a general-purpose hashing function: it runs at a good
speed (competitive with Spooky and City) and permits strong keyed
hashing. This lets you key your hash tables from a strong RNG, such as
rand::os::OsRng.
Although the SipHash algorithm is considered to be generally strong, it is not intended for cryptographic purposes. As such, all cryptographic uses of this implementation are strongly discouraged.
Fields
0: SipHasher24
Implementations
impl SipHasher
fn new() -> SipHasherCreates a new
SipHasherwith the two initial keys set to 0.fn new_with_keys(key0: u64, key1: u64) -> SipHasherCreates a
SipHasherthat is keyed off the provided keys.
Trait Implementations
impl Clone for SipHasher
fn clone(&self) -> SipHasher
impl Debug for SipHasher
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Default for SipHasher
fn default() -> SipHasher
impl Hasher for SipHasher
fn write(&mut self, msg: &[u8])fn write_str(&mut self, s: &str)fn finish(&self) -> u64
Auto Trait Implementations
impl Freeze for SipHasher
impl RefUnwindSafe for SipHasher
impl Send for SipHasher
impl Sync for SipHasher
impl Unpin for SipHasher
impl UnsafeUnpin for SipHasher
impl UnwindSafe for SipHasher
Blanket Implementations
impl<T> Any for SipHasher
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for SipHasher
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for SipHasher
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> CloneToUninit for SipHasher
where
T: Clone,
unsafe fn clone_to_uninit(&self, dest: *mut u8)
impl<T> From<T> for SipHasher
fn from(t: T) -> TReturns the argument unchanged.
impl<T> SizeHint for SipHasher
where
T: ?Sized,
fn lower_bound(&self) -> usizefn upper_bound(&self) -> Option<usize>
impl<T> SizedTypeProperties for SipHasher
impl<T, U> Into<U> for SipHasher
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for SipHasher
where
U: Into<T>,
type Error = Infallible;fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto<U> for SipHasher
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>