augment-vir - v31.17.1
    Preparing search index...

    Class SeededRandom

    A class that produces deterministic, pseudo random numbers based on a given seed. This uses the Alea v0.9 algorithm from Johannes Baagøe.

    import {SeededRandom} from '@augment-vir/common';

    const random = SeededRandom.fromSeed('hello there');
    console.info(random.next()); // this value will always be the same

    const random2 = SeededRandom.fromState(random.exportState());
    console.info(random.next(), random2.next()); // both of these values will always be identical

    const random3 = random2.clone();
    console.info(random.next(), random2.next(), random3.next()); // all of these values will always be identical
    Index

    Methods