Trait ethcore_util::common::hash::FixedHash [] [src]

pub trait FixedHash {
    fn new() -> Self;
    fn zero() -> Self;
    fn random() -> Self;
    fn randomize(&mut self);
    fn len() -> usize;
    fn from_slice(src: &[u8]) -> Self;
    fn clone_from_slice(&mut self, src: &[u8]) -> usize;
    fn copy_to(&self, dest: &mut [u8]);
    fn contains(&'a self, b: &'a Self) -> bool;
    fn is_zero(&self) -> bool;
    fn low_u64(&self) -> u64;
}

Trait for a fixed-size byte array to be used as the output of hash functions.

Required Methods

Create a new, zero-initialised, instance.

Synonym for new(). Prefer to new as it's more readable.

Create a new, cryptographically random, instance.

Assign self have a cryptographically random value.

Get the size of this object in bytes.

Convert a slice of bytes of length len() to an instance of this type.

Assign self to be of the same value as a slice of bytes of length len().

Copy the data of this object into some mutable slice of length len().

Returns true if all bits set in b are also set in self.

Returns true if no bits are set.

Returns the lowest 8 bytes interpreted as a BigEndian integer.

Implementors