fernhash is a simple, fast, non-cryptographic, SIMD-optimized hash function implemented in Rust. It is suitable for hash maps, checksums, and your general data needs.
⚠️ Warning! Fernhash is not cryptographically secure. Do not use it for passwords, signatures, or any cryptographic purposes.
- Optimized for small and large inputs
- On x86_64, SIMD accelerated with AVX2
- Support for custom seeds
- Implements
std::hash::HasherandBuildHasher - Useful for
HashMap/HashSetkey hashing
Add to your Cargo.toml:
fernhash = { git = "github.com/s0uthview/fernhash" }use fernhash::fernhash;
let data = b"Hello, world!";
let seed = 42;
let hash = fernhash(data, seed);
println!("Hash: {:?}", hash);use fernhash::BuildFernHasher;
use std::collections::HashMap;
let mut map: HashMap<&str, u64, BuildFernHasher> =
HashMap::with_hasher(BuildFernHasher::new());
map.insert("key", 123);
println!("Value: {:?}", map.get("key"));Feel free to check out the examples folder to get a better feel for the crate. I think ferns are really cool plants :>