pub struct SseHash { /* private fields */ }
Expand description
SSE empowered implementation that will only work on x86_64
with sse 4.1 enabled at the CPU
level.
Implementations§
Source§impl SseHash
impl SseHash
Sourcepub unsafe fn force_new(key: Key) -> Self
Available with target feature sse4.1
only.
pub unsafe fn force_new(key: Key) -> Self
sse4.1
only.Creates a new SseHash
while circumventing the runtime check for sse4.1.
§Safety
If called on a machine without sse4.1, a segfault will occur. Only use if you have control over the deployment environment and have either benchmarked that the runtime check is significant or are unable to check for sse4.1 capabilities
Sourcepub unsafe fn force_from_checkpoint(data: [u8; 164]) -> Self
Available with target feature sse4.1
only.
pub unsafe fn force_from_checkpoint(data: [u8; 164]) -> Self
sse4.1
only.Creates a new SseHash
from a checkpoint while circumventing the runtime check for sse4.1.
§Safety
See Self::force_new
for safety concerns.
Sourcepub fn from_checkpoint(data: [u8; 164]) -> Option<Self>
pub fn from_checkpoint(data: [u8; 164]) -> Option<Self>
Create a new SseHash
from a checkpoint if the sse4.1 feature is detected
Trait Implementations§
Source§impl Hasher for SseHash
impl Hasher for SseHash
1.26.0 · Source§fn write_u128(&mut self, i: u128)
fn write_u128(&mut self, i: u128)
Writes a single
u128
into this hasher.1.3.0 · Source§fn write_usize(&mut self, i: usize)
fn write_usize(&mut self, i: usize)
Writes a single
usize
into this hasher.1.26.0 · Source§fn write_i128(&mut self, i: i128)
fn write_i128(&mut self, i: i128)
Writes a single
i128
into this hasher.1.3.0 · Source§fn write_isize(&mut self, i: isize)
fn write_isize(&mut self, i: isize)
Writes a single
isize
into this hasher.Source§fn write_length_prefix(&mut self, len: usize)
fn write_length_prefix(&mut self, len: usize)
🔬This is a nightly-only experimental API. (
hasher_prefixfree_extras
)Writes a length prefix into this hasher, as part of being prefix-free. Read more
Source§impl HighwayHash for SseHash
impl HighwayHash for SseHash
Source§fn append(&mut self, data: &[u8])
fn append(&mut self, data: &[u8])
Adds data to be hashed. If it is important, the performance characteristics of this
function differs depending on the amount of data previously hashed and the amount of
data to be hashed. For instance, if one appends 50, 1 byte slices then appending the 32nd
byte will have a performance outlier as the internal 32 byte block is complete and internally processed.
Source§fn finalize64(self) -> u64
fn finalize64(self) -> u64
Consumes the hasher to return the 64bit hash
Source§fn finalize128(self) -> [u64; 2]
fn finalize128(self) -> [u64; 2]
Consumes the hasher to return the 128bit hash
Source§fn finalize256(self) -> [u64; 4]
fn finalize256(self) -> [u64; 4]
Consumes the hasher to return the 256bit hash
Source§fn checkpoint(&self) -> [u8; 164]
fn checkpoint(&self) -> [u8; 164]
Serialize the hasher state to be persisted or resumed by another hasher Read more
Source§fn hash64(self, data: &[u8]) -> u64
fn hash64(self, data: &[u8]) -> u64
Convenience function for hashing all data in a single call and receiving a 64bit hash.
Results are equivalent to appending the data manually.
Source§impl Write for SseHash
impl Write for SseHash
Source§fn write(&mut self, bytes: &[u8]) -> Result<usize>
fn write(&mut self, bytes: &[u8]) -> Result<usize>
Writes a buffer into this writer, returning how many bytes were written. Read more
Source§fn flush(&mut self) -> Result<()>
fn flush(&mut self) -> Result<()>
Flushes this output stream, ensuring that all intermediately buffered
contents reach their destination. Read more
Source§fn is_write_vectored(&self) -> bool
fn is_write_vectored(&self) -> bool
🔬This is a nightly-only experimental API. (
can_vector
)1.0.0 · Source§fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
Attempts to write an entire buffer into this writer. Read more
Source§fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
🔬This is a nightly-only experimental API. (
write_all_vectored
)Attempts to write multiple buffers into this writer. Read more
Auto Trait Implementations§
impl Freeze for SseHash
impl RefUnwindSafe for SseHash
impl Send for SseHash
impl Sync for SseHash
impl Unpin for SseHash
impl UnwindSafe for SseHash
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