pub trait HashT: 'static + MaybeSerializeDeserialize + Debug + Clone + Eq + PartialEq<Self> + Hasher<Out = Self::Output> {
    type Output: HashOutput;

    // Required methods
    fn ordered_trie_root(
        input: Vec<Vec<u8, Global>, Global>,
        state_version: StateVersion
    ) -> Self::Output;
    fn trie_root(
        input: Vec<(Vec<u8, Global>, Vec<u8, Global>), Global>,
        state_version: StateVersion
    ) -> Self::Output;

    // Provided methods
    fn hash(s: &[u8]) -> Self::Output { ... }
    fn hash_of<S>(s: &S) -> Self::Output
       where S: Encode { ... }
}
Expand description

Abstraction around hashing

Required Associated Types§

type Output: HashOutput

The hash type produced.

Required Methods§

fn ordered_trie_root( input: Vec<Vec<u8, Global>, Global>, state_version: StateVersion ) -> Self::Output

The ordered Patricia tree root of the given input.

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

The Patricia tree root of the given mapping.

Provided Methods§

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

Produce the hash of some byte-slice.

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

Produce the hash of some codec-encodable value.

Implementors§

§

impl Hash for BlakeTwo256

§

type Output = H256

§

impl Hash for Keccak256

§

type Output = H256