Stable Hash: Add feature, adjust CI, modify build.rs, add new API for accessing and setting the ahash seed in config.rs, make config.rs public

This commit is contained in:
l1npengtul
2022-10-31 22:14:09 +09:00
parent e75709f627
commit 3e6a3a2759
8 changed files with 157 additions and 23 deletions

View File

@@ -77,7 +77,7 @@ impl BuildHasher for StraightHasherBuilder {
#[inline(always)]
#[must_use]
pub fn get_hasher() -> ahash::AHasher {
match config::AHASH_SEED {
match config::get_rhai_ahash_seed() {
Some([seed1, seed2, seed3, seed4]) if seed1 | seed2 | seed3 | seed4 != 0 => {
ahash::RandomState::with_seeds(seed1, seed2, seed3, seed4).build_hasher()
}