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 6fd6a8a commit b9ca726Copy full SHA for b9ca726
src/lib.rs
@@ -284,4 +284,29 @@ mod tests {
284
hash(HashBytes(b"These are some bytes for testing rustc_hash.")) == if B32 { 2345708736 } else { 12390864548135261390 },
285
}
286
287
+
288
+ #[test]
289
+ fn with_seed_actually_different() {
290
+ let seeds = [
291
+ [1, 2],
292
+ [42, 17],
293
+ [124436707, 99237],
294
+ [usize::MIN, usize::MAX],
295
+ ];
296
297
+ for [a_seed, b_seed] in seeds {
298
+ let a = || FxHasher::with_seed(a_seed);
299
+ let b = || FxHasher::with_seed(b_seed);
300
301
+ for x in u8::MIN..=u8::MAX {
302
+ let mut a = a();
303
+ let mut b = b();
304
305
+ x.hash(&mut a);
306
+ x.hash(&mut b);
307
308
+ assert_ne!(a.finish(), b.finish())
309
+ }
310
311
312
0 commit comments