Function triehash::ordered_trie_root [−][src]
pub fn ordered_trie_root<H, I>(input: I) -> H::Out where
I: IntoIterator,
I::Item: AsRef<[u8]>,
H: Hasher,
<H as Hasher>::Out: Ord,
Generates a trie root hash for a vector of values
use hex_literal::hex; use ethereum_types::H256; use triehash::ordered_trie_root; use keccak_hasher::KeccakHasher; let v = &["doe", "reindeer"]; let root = H256::from(hex!("e766d5d51b89dc39d981b41bda63248d7abce4f0225eefd023792a540bcffee3")); assert_eq!(ordered_trie_root::<KeccakHasher, _>(v), root.as_ref());