use rand::rngs::StdRng;
use rand::prelude::{Rng, SeedableRng, IndexedRandom};

/// Send-safe random range
pub fn random_range(min: u64, max: u64) -> u64 {
    let mut rng = StdRng::from_rng(&mut rand::rng());
    rng.random_range(min..max)
}

/// Send-safe random choice
pub fn choose_random<T: Clone>(items: &[T]) -> T {
    let mut rng = StdRng::from_rng(&mut rand::rng());
    items.choose(&mut rng).unwrap().clone()
}