Expand description
§MuseAir
MuseAir is a portable hashing algorithm that heavily optimized for performance and quality, incorporating structures never before implemented. Complete algorithm analysis is available in the repository.
-
Even faster, outperforming previous fastest wyhash and rapidhash.
-
Improved quality, not vulnerable to blinding multiplication like wyhash or rapidhash, making it ideal for persistent file formats or communication protocols (though note the algorithm is not yet stable).
-
Platform independent, no dependencies on specialized instruction sets like cryptography or vectorization, runs optimally on most 64-bit architectures.
-
Compile-time hashing, as the implementation is fully
const. -
No-std compatible, zero unsafe code and zero dependencies.
-
Non-cryptographic, not intended for security-critical applications.
§Usage
let seed: u64 = 1123;
let v1: u64 = museair::hash("K--Aethiax".as_bytes(), seed);
let v2: u64 = {
let mut hasher = museair::Hasher::new(seed);
hasher.write("K--Ae".as_bytes());
hasher.write("thiax".as_bytes());
hasher.finish()
};
let v3: u128 = museair::hash_128("K--Aethiax".as_bytes(), seed);
let v4: u128 = {
let mut hasher = museair::Hasher::new(seed);
hasher.write("K--Ae".as_bytes());
hasher.write("thiax".as_bytes());
hasher.finish_128()
};
assert_eq!(v1, v2);
assert_eq!(v3, v4);§Use with hashmap
This crate provides helper types that require enabling the std feature.
use museair::{HashMap, FixedState};
let mut map = HashMap::default();
map.insert("hello", "world");
let mut map = HashMap::with_hasher(FixedState::new(42));
map.insert("hello", "world");§Feature flags
§Benchmarks
Benchmarks conducted on AMD Ryzen 7 5700G desktop.
§Hashing bulk datas
![]() |
![]() |
§Hashing small keys
For common 1-32 byte keys, MuseAir has a significant speed advantage (avg. 13.0 cycles/hash), even outperforming fxhash.
§Quality
All MuseAir variants have passed the complete SMHasher3 extended test suite (with --extra flag). As the de facto standard for non-cryptographic hashing quality, passing these tests confirms production readiness. See full results in the repository.
§Versioning
The current MSRV (Minimum Supported Rust Version) is 1.83.0. MSRV changes are considered breaking changes.
Modules§
- bfast
- The BFast variant of the MuseAir hashing algorithm.
- impls
- Implementation details of the MuseAir hashing algorithm.
Functions§
- hash
- Computes the 64-bit MuseAir hash for a byte slice. (standard variant)
- hash_
128 - Computes the 128-bit MuseAir hash for a byte slice. (standard variant)
Type Aliases§
- Fixed
State - A
BuildHasherfor the MuseAir incrementalHasherthat always has the same fixed seed. (standard variant) - HashMap
std - A
HashMaptype that uses the MuseAir incrementalHasher. (standard variant) - HashSet
std - A
HashSettype that uses the MuseAir incrementalHasher. (standard variant) - Hasher
- An incremental
Hasherinstance that uses the MuseAir hashing algorithm. (standard variant)

