Closed kurtlawrence closed 1 month ago
I am seeing different hash values when compiling with/without -Ctarget-cpu=native
-Ctarget-cpu=native
> cargo r Hello, world! 2812988653723342679 > RUSTFLAGS='-C target-cpu=native' cargo r Hello, world! 10721529036479106072
Cargo.toml: ``` [package] name = "hash-test" version = "0.1.0" edition = "2021" [dependencies] ahash = "0.8.11" ``` src/main.rs: ``` use ahash::RandomState; const HASHER: RandomState = RandomState::with_seeds(42, 42, 42, 42); fn main() { let name = "Hello, world!"; println!("{}", name); println!("{}", HASHER.hash_one(name)); } ```
Yes. This is deliberate. See the README.
I am seeing different hash values when compiling with/without
-Ctarget-cpu=native
Files
Cargo.toml: ``` [package] name = "hash-test" version = "0.1.0" edition = "2021" [dependencies] ahash = "0.8.11" ``` src/main.rs: ``` use ahash::RandomState; const HASHER: RandomState = RandomState::with_seeds(42, 42, 42, 42); fn main() { let name = "Hello, world!"; println!("{}", name); println!("{}", HASHER.hash_one(name)); } ```