This commit is contained in:
debris 2015-12-04 13:12:11 +01:00
parent 2805dfe22d
commit 94edc594d7
2 changed files with 15 additions and 2 deletions

View File

@ -1,8 +1,22 @@
//! Wrapper around tiny-keccak crate.
use std::mem::uninitialized;
use tiny_keccak::Keccak;
use bytes::BytesConvertable;
use hash::{FixedHash, H256};
/// Types implementing this trait are sha3able.
///
/// ```
/// extern crate ethcore_util as util;
/// use std::str::FromStr;
/// use util::sha3::*;
/// use util::hash::*;
///
/// fn main() {
/// assert_eq!([0u8; 0].sha3(), H256::from_str("c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470").unwrap());
/// }
/// ```
pub trait Hashable {
fn sha3(&self) -> H256;
}

View File

@ -1,4 +1,4 @@
//! Generete trie root.
//! Generetes trie root.
//!
//! This module should be used to generate trie root hash.
@ -10,7 +10,6 @@ use rlp;
use rlp::RlpStream;
use vector::SharedPrefix;
// todo: verify if example for ordered_trie_root is valid
/// Generates a trie root hash for a vector of values
///
/// ```rust