1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
pub fn xorshift32(seed: u32) -> u32 {
let mut x = seed;
x ^= x << 13;
x ^= x >> 17;
x ^= x << 5;
x
}
pub struct XorShift32(u32);
impl XorShift32 {
pub fn next(&mut self) -> u32 {
self.0 = xorshift32(self.0);
self.0
}
}
impl Default for XorShift32 {
fn default() -> Self {
XorShift32(2463534242)
}
}
// TODO:
#[cfg(test)]
mod tests {
#[test]
fn test() {}
}