new RandomDataGenerator(seeds)
An extremely useful repeatable random data generator.
Based on Nonsense by Josh Faul https://github.com/jocafa/Nonsense.
The random number genererator is based on the Alea PRNG, but is modified.
 https://github.com/coverslide/nodealea
 https://github.com/nquinlan/betterrandomnumbersforjavascriptmirror
 http://baagoe.org/en/wiki/Better_random_numbers_for_javascript (original, perm. 404)
Parameters
Name  Type  Argument  Description 

seeds 
Array.<any> 
<optional> 
An array of values to use as the seed. 
 Source code: math/RandomDataGenerator.js (Line 23)
Public Methods

angle() → {number}

Returns a random angle between 180 and 180.
Returns
number A random number between 180 and 180.
 Source code: math/RandomDataGenerator.js (Line 291)

between(min, max) → {number}

Returns a random integer between and including min and max. This method is an alias for RandomDataGenerator.integerInRange.
Parameters
Name Type Description min
number The minimum value in the range.
max
number The maximum value in the range.
Returns
number A random number between min and max.
 Source code: math/RandomDataGenerator.js (Line 191)

frac() → {number}

Returns a random real number between 0 and 1.
Returns
number A random real number between 0 and 1.
 Source code: math/RandomDataGenerator.js (Line 153)

integer() → {number}

Returns a random integer between 0 and 2^32.
Returns
number A random integer between 0 and 2^32.
 Source code: math/RandomDataGenerator.js (Line 141)

integerInRange(min, max) → {number}

Returns a random integer between and including min and max.
Parameters
Name Type Description min
number The minimum value in the range.
max
number The maximum value in the range.
Returns
number A random number between min and max.
 Source code: math/RandomDataGenerator.js (Line 177)

normal() → {number}

Returns a random real number between 1 and 1.
Returns
number A random real number between 1 and 1.
 Source code: math/RandomDataGenerator.js (Line 220)

pick(ary) → {any}

Returns a random member of
array
.Parameters
Name Type Description ary
Array An Array to pick a random member of.
Returns
any A random member of the array.
 Source code: math/RandomDataGenerator.js (Line 251)

real() → {number}

Returns a random real number between 0 and 2^32.
Returns
number A random real number between 0 and 2^32.
 Source code: math/RandomDataGenerator.js (Line 165)

realInRange(min, max) → {number}

Returns a random real number between min and max.
Parameters
Name Type Description min
number The minimum value in the range.
max
number The maximum value in the range.
Returns
number A random number between min and max.
 Source code: math/RandomDataGenerator.js (Line 206)

sow(seeds)

Reset the seed of the random data generator.
Note: the seed array is only processed up to the first
undefined
(ornull
) value, should such be present.Parameters
Name Type Description seeds
Array.<any> The array of seeds: the
toString()
of each value is used. Source code: math/RandomDataGenerator.js (Line 76)

timestamp(min, max) → {number}

Returns a random timestamp between min and max, or between the beginning of 2000 and the end of 2020 if min and max aren't specified.
Parameters
Name Type Description min
number The minimum value in the range.
max
number The maximum value in the range.
Returns
number A random timestamp between min and max.
 Source code: math/RandomDataGenerator.js (Line 277)

uuid() → {string}

Returns a valid RFC4122 version4 ID hex string from https://gist.github.com/1308368
Returns
string A valid RFC4122 version4 ID hex string
 Source code: math/RandomDataGenerator.js (Line 232)

weightedPick(ary) → {any}

Returns a random member of
array
, favoring the earlier entries.Parameters
Name Type Description ary
Array An Array to pick a random member of.
Returns
any A random member of the array.
 Source code: math/RandomDataGenerator.js (Line 264)