Skip to content

Commit

Permalink
Use correct state var for generating new number, fix order of operati…
Browse files Browse the repository at this point in the history
…ons for first rotl
  • Loading branch information
michaeldzjap committed Jul 31, 2024
1 parent 9a03ca9 commit b5fe4f1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Algorithms/Xoshiro128ss.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ class Xoshiro128ss extends Base implements Algorithm {
*/
public next(): number {
const t = this.b << 9;
let r = this.a * 5;
let r = this.b * 5;

r = (r << 7) | ((r >>> 25) * 9);
r = ((r << 7) | (r >>> 25)) * 9;

this.c ^= this.a;
this.d ^= this.b;
Expand Down

0 comments on commit b5fe4f1

Please sign in to comment.