Struct zeros::Keccak[][src]

pub struct Keccak { /* fields omitted */ }

Keccak

Examples

use zeros::Hash;

let mut keccak = Hash::Shake128.new_keccak();
keccak.update("test");
assert_eq!(
    keccak.finish(),
    &[
        0xd3, 0xb0, 0xaa, 0x9c, 0xd8, 0xb7, 0x25, 0x56,
        0x22, 0xce, 0xbc, 0x63, 0x1e, 0x86, 0x7d, 0x40,
    ],
);

Implementations

impl Keccak[src]

pub const fn hash(&self) -> &Hash[src]

pub fn update<B>(&mut self, bytes: B) -> usize where
    B: AsRef<[u8]>, 
[src]

Updates new data

Returns length of input bytes.

pub fn finish(self) -> Vec<u8>[src]

pub fn finish_as_hex(self) -> String[src]

Trait Implementations

impl Clone for Keccak[src]

impl Debug for Keccak[src]

impl Eq for Keccak[src]

impl From<&'_ Hash> for Keccak[src]

impl From<Hash> for Keccak[src]

impl PartialEq<Keccak> for Keccak[src]

impl StructuralEq for Keccak[src]

impl StructuralPartialEq for Keccak[src]

impl Write for Keccak[src]

Auto Trait Implementations

impl RefUnwindSafe for Keccak

impl Send for Keccak

impl Sync for Keccak

impl Unpin for Keccak

impl UnwindSafe for Keccak

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

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.