We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3a5e0c4 commit 71de84eCopy full SHA for 71de84e
src/lib.rs
@@ -286,4 +286,29 @@ mod tests {
286
hash(HashBytes(b"These are some bytes for testing rustc_hash.")) == if B32 { 2345708736 } else { 12390864548135261390 },
287
}
288
289
+
290
+ #[test]
291
+ fn with_seed_actually_different() {
292
+ let seeds = [
293
+ [1, 2],
294
+ [42, 17],
295
+ [124436707, 99237],
296
+ [usize::MIN, usize::MAX],
297
+ ];
298
299
+ for [a_seed, b_seed] in seeds {
300
+ let a = || FxHasher::with_seed(a_seed);
301
+ let b = || FxHasher::with_seed(b_seed);
302
303
+ for x in u8::MIN..=u8::MAX {
304
+ let mut a = a();
305
+ let mut b = b();
306
307
+ x.hash(&mut a);
308
+ x.hash(&mut b);
309
310
+ assert_ne!(a.finish(), b.finish())
311
+ }
312
313
314
0 commit comments