[][src]Trait sp_runtime::traits::Hash

pub trait Hash: 'static + MaybeSerializeDeserialize + Debug + Clone + Eq + PartialEq {
    type Output: Member + MaybeSerializeDeserialize + Debug + Hash + AsRef<[u8]> + AsMut<[u8]> + Copy + Default + Encode + Decode;
    type Hasher: Hasher<Out = Self::Output>;
    fn hash(s: &[u8]) -> Self::Output;
fn ordered_trie_root(input: Vec<Vec<u8>>) -> Self::Output;
fn trie_root(input: Vec<(Vec<u8>, Vec<u8>)>) -> Self::Output; fn hash_of<S: Encode>(s: &S) -> Self::Output { ... } }

Abstraction around hashing

Associated Types

type Output: Member + MaybeSerializeDeserialize + Debug + Hash + AsRef<[u8]> + AsMut<[u8]> + Copy + Default + Encode + Decode

The hash type produced.

type Hasher: Hasher<Out = Self::Output>

The associated hash_db Hasher type.

Loading content...

Required methods

fn hash(s: &[u8]) -> Self::Output

Produce the hash of some byte-slice.

fn ordered_trie_root(input: Vec<Vec<u8>>) -> Self::Output

The ordered Patricia tree root of the given input.

fn trie_root(input: Vec<(Vec<u8>, Vec<u8>)>) -> Self::Output

The Patricia tree root of the given mapping.

Loading content...

Provided methods

fn hash_of<S: Encode>(s: &S) -> Self::Output

Produce the hash of some codec-encodable value.

Loading content...

Implementors

impl Hash for BlakeTwo256[src]

type Output = H256

type Hasher = Blake2Hasher

Loading content...