[][src]Struct inc_sha1::Hasher

pub struct Hasher { /* fields omitted */ }

An in-progress SHA-1 hash operation.

This struct’s API is intentionally similar to std::hash::Hasher in an attempt at familiarity; however, it does not actually implement that trait because that trait only permits 64-bit hash outputs, while SHA-1 has a 160-bit output.

A Hasher can be cloned and copied. Doing so yields a second Hasher which acts as if it has had exactly the same sequence of bytes written to it as the original, but can freely diverge from that point forward.


impl Hasher[src]

#[must_use]pub fn new() -> Self[src]

Constructs a new Hasher.

The new Hasher does not yet contain any data.

pub fn write(&mut self, bytes: &[u8])[src]

Adds data to a Hasher.

#[must_use]pub fn finish(&self) -> Hash[src]

Returns the hash of the data written so far.

The Hasher is still usable after this, and more data can be added if desired.

Trait Implementations

impl Clone for Hasher[src]

impl Copy for Hasher[src]

impl Default for Hasher[src]

Auto Trait Implementations

impl RefUnwindSafe for Hasher

impl Send for Hasher

impl Sync for Hasher

impl Unpin for Hasher

impl UnwindSafe for Hasher

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T> ToOwned for T where
    T: Clone

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.