bobzhang/faker/randomizer does not have a README file

    RandomSource

    pub(open) trait RandomSource {
    fn next(Self) -> Double
    fn seed(Self, UInt) -> Unit
    fn seed_array(Self, ArrayView[UInt]) -> Unit
    }

    Custom random sources must produce values in [0, 1) and support reseeding.

    Randomizer

    pub struct Randomizer {
    state : FixedArray[UInt]
    index : Int
    precision32 : Bool
    }

    MT19937 with the same scalar/array seeding and 53-bit output as Faker JS.

    Randomizer::Randomizer

    fn Randomizer::Randomizer(seed? : UInt, precision32? : Bool) -> Randomizer

    Randomizer::next

    fn Randomizer::next(self : Randomizer) -> Double

    A uniformly distributed value in [0, 1), using 53 random bits.

    Randomizer::next_f32

    fn Randomizer::next_f32(self : Randomizer) -> Double

    A uniformly distributed value in [0, 1), using 32 random bits.

    Randomizer::next_u32

    fn Randomizer::next_u32(self : Randomizer) -> UInt

    Randomizer::seed

    fn Randomizer::seed(self : Randomizer, seed : UInt) -> Unit

    Randomizer::seed_array

    fn Randomizer::seed_array(self : Randomizer, seeds : ArrayView[UInt]) -> Unit

    Seed with a nonempty sequence of 32-bit words. Panics if the seed array is empty.