initial commit

This commit is contained in:
Sebastian Hugentobler 2023-11-15 16:26:35 +01:00
commit 2a9f427bc7
Signed by: shu
GPG key ID: BB32CF3CA052C2F0
21 changed files with 3692 additions and 0 deletions

12
src/hash.rs Normal file
View file

@ -0,0 +1,12 @@
use std::hash::Hasher;
use fnv::FnvHasher;
pub fn fnv_str(input: &str) -> String {
let mut hasher = FnvHasher::default();
hasher.write(input.as_bytes());
let hash = hasher.finish();
let short_hash = format!("{:x}", hash);
short_hash
}