Skip to content

Commit

Permalink
fix: improve default seed initialization (#1334)
Browse files Browse the repository at this point in the history
  • Loading branch information
shraddhafalane authored Sep 8, 2022
1 parent b9884d0 commit 925db3a
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 MersenneModule {
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(MersenneModule.prototype)) {
Expand Down

0 comments on commit 925db3a

Please sign in to comment.