You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let mut data = vec![];
let f = File::open("/file");
let mut f = match f {
Ok(file) => file,
Err(e) => panic!("Error [{:}]",e),
};
let mut hasher = XxHash64::with_seed(0);
let f = TeeReader::new(&mut reader, &mut hasher);
let n = f.read_to_end(&mut data).expect("Didn't read enough");
println!("{:16x}", hasher.finish())
The text was updated successfully, but these errors were encountered:
use std::fs::File;use twox_hash::XxHash64;fnmain(){letmut f = File::open("/etc/hosts").expect("Unable to open file");let hasher = XxHash64::with_seed(0);letmut hw = HashWriter(hasher);
io::copy(&mut f,&mut hw).expect("Unable to copy data");let hasher = hw.0;println!("{}", hasher.finish());}
use hasher as writer to calculate hash
The text was updated successfully, but these errors were encountered: