mirror of
https://github.com/MrBeanCpp/MIT.git
synced 2026-04-15 11:00:11 +08:00
初步搭建代码框架 包括objects, tests, utils
This commit is contained in:
1
src/utils/mod.rs
Normal file
1
src/utils/mod.rs
Normal file
@@ -0,0 +1 @@
|
||||
pub mod util;
|
||||
11
src/utils/util.rs
Normal file
11
src/utils/util.rs
Normal 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)
|
||||
}
|
||||
Reference in New Issue
Block a user