Xoshiro

The Xoshiro deteministic random number source uses the Xoshiro256PlusPlus pseudorandom number generator. It can be seeded with an u64. It mainly exists for testing purposes.

The implementation uses the jump() function of the PRNG to skip \( n * 2^{64} \) bytes of the output stream, giving it independent streams.

#![allow(unused)]
fn main() {
pub struct Xoshiro(u64);

impl RandomSource for Xoshiro {
    type Rng = Xoshiro256PlusPlus;

    fn get_rng(&self, index: usize) -> Self::Rng {
        let mut rng = Xoshiro256PlusPlus::seed_from_u64(self.0);
        for _ in 0..index {
            rng.jump();
        }
        rng
    }
}
}