MCPcopy Create free account
hub / github.com/RandomAPI/Randomuser.me-Node / seedRNG

Method seedRNG

api/1.2/api.js:260–270  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

258
259 // Seeds Mersenne Twister PRNG
260 seedRNG() {
261 let seed = this.seed;
262 if (this.seed.length === 18) {
263 seed = this.seed.substring(0, 16);
264 }
265 seed = this.page !== 1 ? seed + String(this.page) : seed;
266
267 seed = parseInt(crypto.createHash('md5').update(seed).digest('hex').substring(0, 8), 16);
268 mersenne.seed(seed);
269 faker.seed(seed);
270 }
271
272 // Choose random seed
273 defaultSeed() {

Callers 1

generateMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected