| Crates.io | fhash |
| lib.rs | fhash |
| version | 0.7.1 |
| created_at | 2023-08-02 23:22:31.432059+00 |
| updated_at | 2024-01-21 01:29:07.14061+00 |
| description | Blazingly fast hash for HashMaps in Rust |
| homepage | https://github.com/engusmaze/fhash |
| repository | https://github.com/engusmaze/fhash |
| max_upload_size | |
| id | 933219 |
| size | 27,190 |
FHash is a simple and lightweight hashing crate designed for flexibility, speed, and usability across various Rust environments. It provides a basic hashing algorithm, FHasher, along with a RandomState implementation intended for use in HashMap and HashSet structures. It's a direct competitor to AHash and is 1.3-2.0x faster.
FHasher instances.HashMap and HashSet to enhance resilience against potential vulnerabilities in the hash function.use hashbrown::HashMap;
use fhash::RandomState;
let mut map: HashMap<i32, &str, RandomState> = HashMap::default();
map.insert(1, "apple");
map.insert(2, "banana");
assert_eq!(map.get(&1), Some(&"apple"));
assert_eq!(map.get(&2), Some(&"banana"));
use fhash::FHasher;
let mut hasher = FHasher::default();
hasher.write(b"Hello, world!");
let hash_result = hasher.finish();
no_std Compatible: Can be used in no_std environments or scenarios with limited access to the standard library.Contributions to enhance FHash in terms of optimizations, features, or bug fixes are welcome! Please submit issues or pull requests.