初步搭建代码框架 包括objects, tests, utils

This commit is contained in:
mrbeanc
2023-12-16 18:37:29 +08:00
parent 42e80a53cf
commit e5141c159b
12 changed files with 78 additions and 0 deletions

1
src/utils/mod.rs Normal file
View File

@@ -0,0 +1 @@
pub mod util;

11
src/utils/util.rs Normal file
View File

@@ -0,0 +1,11 @@
use sha1::{
Digest,
Sha1
};
pub fn calc_hash(data: &String) -> String {
let mut hasher = Sha1::new();
hasher.update(data);
let hash = hasher.finalize();
hex::encode(hash)
}