# Class: RandomDataGenerator

## Phaser. RandomDataGenerator

An extremely useful repeatable random data generator. Access it via Phaser.Game.rnd Based on Nonsense by Josh Faul https://github.com/jocafa/Nonsense. Random number generator from http://baagoe.org/en/wiki/Better_random_numbers_for_javascript

#### new RandomDataGenerator(seeds)

  Phaser.RandomDataGenerator constructor.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `seeds` | array |

  Source:
    - math/RandomDataGenerator.js, line 20

### Methods

#### angle() → {number}

  Returns a random angle between -180 and 180.

  Source:
    - math/RandomDataGenerator.js, line 266

  ##### Returns:

  A random number between -180 and 180.

  Type
    number

#### frac() → {number}

  Returns a random real number between 0 and 1.

  Source:
    - math/RandomDataGenerator.js, line 143

  ##### Returns:

  A random real number between 0 and 1.

  Type
    number

#### integer() → {number}

  Returns a random integer between 0 and 2^32.

  Source:
    - math/RandomDataGenerator.js, line 131

  ##### Returns:

  A random integer between 0 and 2^32.

  Type
    number

#### 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.

  Source:
    - math/RandomDataGenerator.js, line 167

  ##### Returns:

  A random number between min and max.

  Type
    number

#### normal() → {number}

  Returns a random real number between -1 and 1.

  Source:
    - math/RandomDataGenerator.js, line 195

  ##### Returns:

  A random real number between -1 and 1.

  Type
    number

#### pick(ary) → {any}

  Returns a random member of `array`.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `ary` | Array | An Array to pick a random member of.

  Source:
    - math/RandomDataGenerator.js, line 226

  ##### Returns:

  A random member of the array.

  Type
    any

#### real() → {number}

  Returns a random real number between 0 and 2^32.

  Source:
    - math/RandomDataGenerator.js, line 155

  ##### Returns:

  A random real number between 0 and 2^32.

  Type
    number

#### 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.

  Source:
    - math/RandomDataGenerator.js, line 181

  ##### Returns:

  A random number between min and max.

  Type
    number

#### sow(seeds)

  Reset the seed of the random data generator.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `seeds` | array |

  Source:
    - math/RandomDataGenerator.js, line 73

#### 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.

  Source:
    - math/RandomDataGenerator.js, line 252

  ##### Returns:

  A random timestamp between min and max.

  Type
    number

#### uuid() → {string}

  Returns a valid RFC4122 version4 ID hex string from https://gist.github.com/1308368

  Source:
    - math/RandomDataGenerator.js, line 207

  ##### Returns:

  A valid RFC4122 version4 ID hex string

  Type
    string

#### 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.

  Source:
    - math/RandomDataGenerator.js, line 239

  ##### Returns:

  A random member of the array.

  Type
    any