Module antithesis_sdk::random

source ·
Expand description

The random module provides functions that request both structured and unstructured randomness from the Antithesis environment.

These functions should not be used to seed a conventional PRNG, and should not have their return values stored and used to make a decision at a later time. Doing either of these things makes it much harder for the Antithesis platform to control the history of your program’s execution, and also makes it harder for Antithesis to learn which inputs provided at which times are most fruitful. Instead, you should call a function from the random package every time your program or workload needs to make a decision, at the moment that you need to make the decision.

These functions are also safe to call outside the Antithesis environment, where they will fall back on the rust std library implementation.


  • Returns a u64 value chosen by Antithesis. You should not store this value or use it to seed a PRNG, but should use it immediately.
  • Returns a randomly chosen item from a list of options. You should not store this value, but should use it immediately.