Function bao::decode::hash_from_encoded [−][src]
pub fn hash_from_encoded<T: Read>(reader: &mut T) -> Result<Hash>
Given a combined encoding beind a Read
interface, quickly determine the root hash by reading
just the root node.
Example
let (hash1, encoded) = bao::encode::encode_to_vec(b"foobar"); let hash2 = bao::decode::hash_from_encoded(&mut &*encoded).unwrap(); assert_eq!(hash1, hash2);