docs
This commit is contained in:
parent
2805dfe22d
commit
94edc594d7
14
src/sha3.rs
14
src/sha3.rs
@ -1,8 +1,22 @@
|
|||||||
|
//! Wrapper around tiny-keccak crate.
|
||||||
|
|
||||||
use std::mem::uninitialized;
|
use std::mem::uninitialized;
|
||||||
use tiny_keccak::Keccak;
|
use tiny_keccak::Keccak;
|
||||||
use bytes::BytesConvertable;
|
use bytes::BytesConvertable;
|
||||||
use hash::{FixedHash, H256};
|
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 {
|
pub trait Hashable {
|
||||||
fn sha3(&self) -> H256;
|
fn sha3(&self) -> H256;
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
//! Generete trie root.
|
//! Generetes trie root.
|
||||||
//!
|
//!
|
||||||
//! This module should be used to generate trie root hash.
|
//! This module should be used to generate trie root hash.
|
||||||
|
|
||||||
@ -10,7 +10,6 @@ use rlp;
|
|||||||
use rlp::RlpStream;
|
use rlp::RlpStream;
|
||||||
use vector::SharedPrefix;
|
use vector::SharedPrefix;
|
||||||
|
|
||||||
// todo: verify if example for ordered_trie_root is valid
|
|
||||||
/// Generates a trie root hash for a vector of values
|
/// Generates a trie root hash for a vector of values
|
||||||
///
|
///
|
||||||
/// ```rust
|
/// ```rust
|
||||||
|
Loading…
Reference in New Issue
Block a user