From b5fe4f1b122246dd8ea1260b253ccbeeb5def79e Mon Sep 17 00:00:00 2001 From: Michael Dzjaparidze Date: Wed, 31 Jul 2024 13:37:35 +0200 Subject: [PATCH] Use correct state var for generating new number, fix order of operations for first rotl --- src/Algorithms/Xoshiro128ss.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Algorithms/Xoshiro128ss.ts b/src/Algorithms/Xoshiro128ss.ts index d797a09..dfd73b5 100644 --- a/src/Algorithms/Xoshiro128ss.ts +++ b/src/Algorithms/Xoshiro128ss.ts @@ -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;