verify local file hash, add retry, add cache busting on retry

This commit is contained in:
2024-09-24 17:53:45 +02:00
parent db3ef786ac
commit 519f70dd45
2 changed files with 44 additions and 11 deletions

View File

@@ -158,3 +158,14 @@ pub fn save_cache(dir: &Path, cache: structs::Cache) {
println_error!("Failed to save cache: {}", e);
});
}
pub fn random_string(length: u32) -> String {
use rand::Rng;
let mut rng = rand::thread_rng();
let mut result = String::new();
for _ in 0..length {
let random: u8 = rng.gen_range(33..127);
result.push(random as char);
}
result
}