vendredi 17 décembre 2021

What is the PRNG algorithm used in Rust's `rand` crate?

I'm writing a web app that will do some financial model simulations. Just for fun and an opportunity to learn new things, I have decided to offload all the math and simulations to a WebAssembly and implement that wasm in Rust.

I am therefore looking at PRNGs for Rust. I found a Mersenne Twister crate and MT is obviously a well-established algorithm (even used by default in several languages), but this particular crate does not seem to be very popular. I also understand that Rust has a rand crate "built-in" (if that's even a thing) but I haven't found any info as to:

  • What is the algorithm used in rand?
  • How does that algorithm stack up to others (e.g. MT) in terms of randomness quality?

To be clear: I'm evaluating algorithms for statistical randomness (simulating stochastic processes), not cryptographic security.




Aucun commentaire:

Enregistrer un commentaire