v0.2.1
This commit is contained in:
@@ -34,9 +34,9 @@ async fn extract_files(zsdiff: &Zsdiff, filename: String) -> Result<String, io::
|
||||
|
||||
async fn check_hash(filename: String) -> Result<(), io::Error> {
|
||||
let file_data = read(format!("{}.zdiff", filename))?;
|
||||
let hash_file = read(format!("{}.zdiff.md5", filename))?;
|
||||
let hash_file = String::from_utf8(read(format!("{}.zdiff.md5", filename))?).unwrap();
|
||||
let hash = utils::get_hash(file_data).await;
|
||||
if !String::from_utf8(hash_file).unwrap().eq(&hash) {
|
||||
if !hash_file.split(" ").next().unwrap().eq(&hash) {
|
||||
return Err(io::Error::new(io::ErrorKind::Other, "Hash mismatch"));
|
||||
}
|
||||
println!("Zsdiff hash: {}", hash);
|
||||
|
||||
Reference in New Issue
Block a user