pub struct Engine { /* private fields */ }Expand description
Engine to compute the SipHash24 hash function.
Implementations§
Trait Implementations§
Source§impl HashEngine for Engine
impl HashEngine for Engine
Source§const BLOCK_SIZE: usize = 32usize
const BLOCK_SIZE: usize = 32usize
Length of the hash’s internal block size, in bytes.
Source§fn n_bytes_hashed(&self) -> usize
fn n_bytes_hashed(&self) -> usize
Return the number of bytes already n_bytes_hashed(inputted).
Source§fn finalize(self) -> Self::Digest
fn finalize(self) -> Self::Digest
Returns the final digest from the current state of the hash engine.
Source§fn midstate(&self) -> State
fn midstate(&self) -> State
Outputs the midstate of the hash engine. This function should not be
used directly unless you really know what you’re doing.
Source§fn hash(bytes: &[u8]) -> Self::Digest
fn hash(bytes: &[u8]) -> Self::Digest
Creates a default hash engine, adds
bytes to it, then finalizes the engine. Read moreSource§fn hash_byte_chunks<B, I>(byte_slices: I) -> Self::Digest
fn hash_byte_chunks<B, I>(byte_slices: I) -> Self::Digest
Hashes all the byte slices retrieved from the iterator together.
Source§impl Write for Engine
Available on crate feature bitcoin-io only.
impl Write for Engine
Available on crate feature
bitcoin-io only.Source§fn write(&mut self, buf: &[u8]) -> Result<usize>
fn write(&mut self, buf: &[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
Source§impl Write for Engine
Available on crate feature bitcoin-io only.
impl Write for Engine
Available on crate feature
bitcoin-io only.Auto Trait Implementations§
impl Freeze for Engine
impl RefUnwindSafe for Engine
impl Send for Engine
impl Sync for Engine
impl Unpin for Engine
impl UnwindSafe for Engine
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