mirror of
https://github.com/alterware/alterware-launcher.git
synced 2025-12-04 07:17:50 +00:00
verify local file hash, add retry, add cache busting on retry
This commit is contained in:
11
src/misc.rs
11
src/misc.rs
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user