From 63175fa2e227cc91145c54764c5bb1764690d6ab Mon Sep 17 00:00:00 2001 From: ironhaven Date: Tue, 17 Oct 2023 08:37:08 +0000 Subject: [PATCH] Remove unnecessary seed modifcation Because the first step of wyrand is an addition with a constant, a non-zero seed is not required --- src/global_rng.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/global_rng.rs b/src/global_rng.rs index 506a97b..2f6d37e 100644 --- a/src/global_rng.rs +++ b/src/global_rng.rs @@ -193,8 +193,7 @@ fn random_seed() -> Option { let mut hasher = DefaultHasher::new(); Instant::now().hash(&mut hasher); thread::current().id().hash(&mut hasher); - let hash = hasher.finish(); - Some((hash << 1) | 1) + Some(hasher.finish()) } #[cfg(all(