[−][src]Struct rand_seeder::SipHasher
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).
Methods
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<H: Hash> From<H> for SipHasher
[src]
impl Debug 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 finish(&self) -> u64
[src]
fn write(&mut self, msg: &[u8])
[src]
fn write_u8(&mut self, i: u8)
[src]
fn write_u16(&mut self, i: u16)
[src]
fn write_u32(&mut self, i: u32)
[src]
fn write_u64(&mut self, i: u64)
[src]
fn write_u128(&mut self, i: u128)
[src]
fn write_usize(&mut self, i: usize)
[src]
For portability reasons, the usize
input is interpreted as a u128
.
fn write_i8(&mut self, i: i8)
[src]
fn write_i16(&mut self, i: i16)
[src]
fn write_i32(&mut self, i: i32)
[src]
fn write_i64(&mut self, i: i64)
[src]
fn write_i128(&mut self, i: i128)
[src]
fn write_isize(&mut self, i: isize)
[src]
For portability reasons, the isize
input is interpreted as a i128
.
impl Clone for SipHasher
[src]
fn clone(&self) -> SipHasher
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Default for SipHasher
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> From<!> for T
[src]
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,