initial commit
This commit is contained in:
commit
2a9f427bc7
21 changed files with 3692 additions and 0 deletions
12
src/hash.rs
Normal file
12
src/hash.rs
Normal 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
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue