ixfx
    Preparing search index...

    Module @ixfx/random - v0.56.0

    @ixfx/random npm

    Please refer to README.md

    Functions

    bipolar

    Returns a random bipolar value

    bipolarSource

    Source for random bipolar values

    calculateNonZero

    Keeps generating a random number until it's not 0

    chance

    Chance of returning a or b, based on threshold p.

    float

    Returns a random float between max (exclusive) and 0 (inclusive).

    floatSource

    Returns a function that produces random float values. Use float to produce a valued directly.

    gaussian

    Returns a random number with gaussian (ie. bell-curved) distribution

    gaussianSource

    Returns a function that generates a gaussian-distributed random number

    integer

    Returns a random integer between max (exclusive) and 0 (inclusive) Use integerSource to return a function instead.

    integerSource

    Returns a function that produces a random integer between max (exclusive) and 0 (inclusive) Use integer if you want a random number directly.

    integerUniqueGen

    Returns a generator over random unique integers, up to but not including the given max value.

    lfsrCompute
    lfsrSource

    Creates a linear feedback shift register (LFSR). Useful for creating deterministic, pseudo-random numbers.

    mersenneTwister

    Reproducible random values using the Merseene Twister algorithm. With the same seed value, it produces the same series of random values.

    minutesMs

    Return a random time value in milliseconds, using minute values to set range.

    minutesMsSource

    Returns a random number of minutes, with a unit of milliseconds.

    mulberrySource

    Generates deterministic pseudo-random numbers using the mulberry32 technique. Uses 0 (inclusive)...1 (exclusive) scale like ``ath.random()`.

    randomElement

    Returns random element.

    randomElementWeightedSource

    Selects a random array index, biased by the provided weightings.

    randomIndex

    Returns a random array index.

    randomPluck

    Plucks a random value from an array, optionally mutating the original array.

    secondsMs

    Generate random time in milliseconds, using seconds to set the bounds

    secondsMsSource

    Returns function which produces a random number of seconds, with a unit of milliseconds.

    shortGuid

    Generates a six-digit roughly unique id

    shuffle

    Returns a shuffled copy of the input array.

    string

    Returns a string of random letters and numbers of a given length.

    weighted

    Returns a random number, 0..1, weighted by a given easing function. See @ixfx/modulation.weighted to use a named easing function. Use weightedSource to return a function instead.

    weightedIndex

    Returns a random number from 0..weightings.length, distributed by the weighting values.

    weightedInteger

    Generate a weighted-random integer.

    weightedIntegerSource

    Random integer, weighted according to an easing function. Number will be inclusive of min and below max.

    weightedSource

    Returns a random number, 0..1, weighted by a given easing function. See @ixfx/modulation.weighted to use a named easing function. Use weighted to get a value directly.

    Type Aliases

    GenerateRandomOptions
    LfsrOptions
    LfsrResult
    RandomBooleanOptions

    Options for generating a random boolean

    RandomNumberOptions
    RandomOptions
    RandomSource

    A random source.

    StringOptions
    WeightedOptions