[][src]Struct rand_seeder::SipHasher

pub struct SipHasher { /* fields omitted */ }

A portable implementation of SipHash 2-4.

This implementation will produce 8-byte (u64) output compliant with the reference implementation. Additionally, it can be extended into an RNG able to produce unlimited output via SipHasher::into_rng.

See: https://131002.net/siphash/

SipHash is a general-purpose hashing function: it runs at a good speed (competitive with Spooky and City) and permits strong keyed hashing.

Although the SipHash algorithm is considered strong, it is not intended for cryptographic uses (e.g. authentication).

Implementations

impl SipHasher[src]

pub fn new() -> Self[src]

Create a new SipHasher (equivalent to from_keys(0, 0)).

pub fn from_keys(key0: u64, key1: u64) -> Self[src]

Create a SipHasher using the given keys.

pub fn into_rng(self) -> SipRng[src]

Finish writes and convert the hasher's core into a generator.

This offers a fast, elegant transition from hash function to generator which maintains (up to) 256 bits of entropy.

Note that this transition has not been reviewed for cryptographic strength, and might break SipHash's security.

Trait Implementations

impl Clone for SipHasher[src]

impl Debug for SipHasher[src]

impl Default for SipHasher[src]

impl<H: Hash> From<H> for SipHasher[src]

impl Hasher for SipHasher[src]

Implements the standard library's Hasher trait.

Note that all methods are implemented directly to fix Endianness, unlike the default implementations in the standard library.

fn write_usize(&mut self, i: usize)[src]

For portability reasons, the usize input is interpreted as a u128.

fn write_isize(&mut self, i: isize)[src]

For portability reasons, the isize input is interpreted as a i128.

Auto Trait Implementations

impl Send for SipHasher

impl Sync for SipHasher

impl Unpin for SipHasher

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<!> for T[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

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.