mirror of
https://github.com/alterware/alterware-launcher.git
synced 2025-12-04 07:17:50 +00:00
seperate into multiple source files
This commit is contained in:
13
src/misc.rs
Normal file
13
src/misc.rs
Normal file
@@ -0,0 +1,13 @@
|
||||
use std::{fs, path::PathBuf};
|
||||
|
||||
pub fn get_file_sha1(path: &PathBuf) -> String {
|
||||
let mut sha1 = sha1_smol::Sha1::new();
|
||||
sha1.update(&fs::read(path).unwrap());
|
||||
sha1.digest().to_string()
|
||||
}
|
||||
|
||||
pub fn stdin() -> String {
|
||||
let mut input = String::new();
|
||||
std::io::stdin().read_line(&mut input).unwrap();
|
||||
input.trim().to_string()
|
||||
}
|
||||
Reference in New Issue
Block a user