Trait digest_hash::Hash[][src]

pub trait Hash {
    fn hash<H>(&self, digest: &mut H)
    where
        H: EndianInput
; }

A cryptographically hashable type.

This trait is similar to std::hash::Hash, with some differences:

  • The choice of provided trait implementations discourages hashing of machine-dependent types, or types without an unambiguous byte stream representation.
  • The standard sequential byte containers are transparent to hashing.
  • The intended recipients of data for hashing are cryptographic hash functions that implement traits defined in crate digest.

This trait can be implemented for a user-defined type to provide it with a cryptographically stable representation for secure hashing.

Required Methods

Feeds this value into the given digest function.

For multi-byte data member values, the byte order is imposed by the implementation of EndianInput that the digest function provides.

Implementations on Foreign Types

impl Hash for u16
[src]

impl Hash for i16
[src]

impl Hash for u32
[src]

impl Hash for i32
[src]

impl Hash for u64
[src]

impl Hash for i64
[src]

impl Hash for f32
[src]

impl Hash for f64
[src]

impl Hash for u8
[src]

impl Hash for i8
[src]

impl<N> Hash for GenericArray<u8, N> where
    N: ArrayLength<u8>, 
[src]

impl<N> Hash for GenericArray<i8, N> where
    N: ArrayLength<i8>, 
[src]

impl<'a, T: ?Sized> Hash for &'a T where
    T: Hash
[src]

impl<T: ?Sized> Hash for Box<T> where
    T: Hash
[src]

impl<T: ?Sized> Hash for Rc<T> where
    T: Hash
[src]

impl<T: ?Sized> Hash for Arc<T> where
    T: Hash
[src]

impl<'a, B: ?Sized> Hash for Cow<'a, B> where
    B: Hash,
    B: ToOwned,
    B::Owned: Hash
[src]

Implementors