pub struct Keccak { /* private fields */ }
Expand description
Implementations§
source§impl Keccak
impl Keccak
sourcepub fn update<B>(&mut self, bytes: B) -> usizewhere
B: AsRef<[u8]>,
pub fn update<B>(&mut self, bytes: B) -> usizewhere
B: AsRef<[u8]>,
Updates new data
Returns length of input bytes.
sourcepub fn update_iter<I, B>(&mut self, iter: I) -> Option<usize>where
I: IntoIterator<Item = B>,
B: AsRef<[u8]>,
pub fn update_iter<I, B>(&mut self, iter: I) -> Option<usize>where
I: IntoIterator<Item = B>,
B: AsRef<[u8]>,
Updates new data
Returns length of input bytes. If overflow happens, None
will be returned.
sourcepub fn finish(self) -> Vec<u8>
pub fn finish(self) -> Vec<u8>
Finishes and returns hash
For large output bytes, you should use finish_as_keccak_x()
, and collect hash from it.
sourcepub fn finish_as_hex(self) -> String
pub fn finish_as_hex(self) -> String
Finishes and returns hash as a hexadecimal string, in lower-case
For large output bytes, you should use finish_as_keccak_x()
, and collect hash from it.
sourcepub fn finish_as_keccak_x(self) -> KeccakX ⓘ
pub fn finish_as_keccak_x(self) -> KeccakX ⓘ
Trait Implementations§
source§impl PartialEq<Keccak> for Keccak
impl PartialEq<Keccak> for Keccak
source§impl Write for Keccak
impl Write for Keccak
source§fn write(&mut self, buf: &[u8]) -> IoResult<usize>
fn write(&mut self, buf: &[u8]) -> IoResult<usize>
Write a buffer into this writer, returning how many bytes were written. Read more
source§fn flush(&mut self) -> IoResult<()>
fn flush(&mut self) -> IoResult<()>
Flush 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