findpenguins-feed/src/hash.rs

13 lines
258 B
Rust
Raw Normal View History

2023-11-15 15:26:35 +00:00
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
}