Skip to content

Commit

Permalink
fix: Improve default seed initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
shraddhafalane committed Sep 6, 2022
1 parent cc18b22 commit fe3bb3e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/modules/mersenne/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export class Mersenne {
private gen = new Gen();

constructor() {
this.gen.initGenrand(new Date().getTime() % 1000000000);
this.gen.initGenrand(Math.ceil(Math.random() * Number.MAX_SAFE_INTEGER));

// Bind `this` so namespaced is working correctly
for (const name of Object.getOwnPropertyNames(Mersenne.prototype)) {
Expand Down

0 comments on commit fe3bb3e

Please sign in to comment.