This commit is contained in:
2025-10-17 14:01:13 +03:00
parent c93bf8f1d2
commit 54500810a0
2 changed files with 4 additions and 3 deletions

View File

@@ -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);