Mersenne
Module to generate seed based random numbers.
rand
Generates a random number between [min, max)
.
Available since v5.5.0
Parameters
Name | Type | Default | Description |
---|---|---|---|
max | number | 32768 | The maximum number. |
min | number | 0 | The minimum number. |
Returns: number
ts
faker.mersenne.rand(max: number = 32768, min: number = 0): number
faker.mersenne.rand() // => 17983
faker.mersenne.rand() // 15515
faker.mersenne.rand(1000, 500) // 578
seed
Sets the seed to use.
Available since v5.5.0
Parameters
Name | Type | Default | Description |
---|---|---|---|
S | number | The seed to use. |
Returns: void
ts
faker.mersenne.seed(S: number): void
seed_array
Sets the seed to use.
Available since v5.5.0
Parameters
Name | Type | Default | Description |
---|---|---|---|
A | number[] | The seed to use. |
Returns: void
ts
faker.mersenne.seed_array(A: number[]): void