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

Method seedRNG

api/1.3/api.js:263–273  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers 1

generateMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected