| { | ||
| "git": { | ||
| "sha1": "a8f98b445d639ad473dbdfdee46dc2d8a792c7fe" | ||
| "sha1": "7e60c7f688f9be3dcd4f59f216c87dac88ca2902" | ||
| }, | ||
| "path_in_vcs": "" | ||
| } |
+1
-1
@@ -16,3 +16,3 @@ # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO | ||
| name = "fastrand" | ||
| version = "2.0.2" | ||
| version = "2.1.0" | ||
| authors = ["Stjepan Glavina <stjepang@gmail.com>"] | ||
@@ -19,0 +19,0 @@ exclude = ["/.*"] |
+8
-0
@@ -0,1 +1,9 @@ | ||
| # Version 2.1.0 | ||
| - Change the RNG algorithm and the way that the seed is computed. This will cause | ||
| the algorithm to emit different constants for different seeds, hence the minor | ||
| SemVer change. | ||
| - Update to the final WyRand v4.2 constants for better entropy. (#82) | ||
| - Remove an unnecessary seed modification. (#73) | ||
| # Version 2.0.2 | ||
@@ -2,0 +10,0 @@ |
@@ -196,4 +196,3 @@ //! A global, thread-local random number generator. | ||
| thread::current().id().hash(&mut hasher); | ||
| let hash = hasher.finish(); | ||
| Some((hash << 1) | 1) | ||
| Some(hasher.finish()) | ||
| } | ||
@@ -200,0 +199,0 @@ |
+7
-2
@@ -151,5 +151,10 @@ //! A simple and fast random number generator. | ||
| fn gen_u64(&mut self) -> u64 { | ||
| let s = self.0.wrapping_add(0xA0761D6478BD642F); | ||
| // Constants for WyRand taken from: https://github.com/wangyi-fudan/wyhash/blob/master/wyhash.h#L151 | ||
| // Updated for the final v4.2 implementation with improved constants for better entropy output. | ||
| const WY_CONST_0: u64 = 0x2d35_8dcc_aa6c_78a5; | ||
| const WY_CONST_1: u64 = 0x8bb8_4b93_962e_acc9; | ||
| let s = self.0.wrapping_add(WY_CONST_0); | ||
| self.0 = s; | ||
| let t = u128::from(s) * u128::from(s ^ 0xE7037ED1A0B428DB); | ||
| let t = u128::from(s) * u128::from(s ^ WY_CONST_1); | ||
| (t as u64) ^ (t >> 64) as u64 | ||
@@ -156,0 +161,0 @@ } |
Sorry, the diff of this file is not supported yet