From e2baf5258091c74a6b401d880c4137166d3c55c9 Mon Sep 17 00:00:00 2001 From: Travis Fischer Date: Wed, 4 Sep 2024 13:56:52 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/generators/arc4.ts | 2 +- src/seed.test.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/generators/arc4.ts b/src/generators/arc4.ts index 7523e9c..deddefb 100644 --- a/src/generators/arc4.ts +++ b/src/generators/arc4.ts @@ -54,7 +54,7 @@ export class ARC4RNG extends RNG { // For more robust unpredictability, the function call below discards an // initial batch of values. This is called RC4-drop. - this.g(768) + this.g(256) } override get name() { diff --git a/src/seed.test.ts b/src/seed.test.ts index b28559e..0fbef75 100644 --- a/src/seed.test.ts +++ b/src/seed.test.ts @@ -29,16 +29,16 @@ test('random.clone with string seed is consistent', () => { test('Random constructor', () => { const rng = new Random() - expect(rng).toBeDefined() + expect(rng.rng.name).toEqual('Math.random') const rng2 = new Random(seedrandom('my-seed-string')) - expect(rng2).toBeDefined() + expect(rng2.rng.name).toEqual('prng') const rng3 = new Random(Math.random) - expect(rng3).toBeDefined() + expect(rng3.rng.name).toEqual('random') const rng4 = new Random('example-seed-string') - expect(rng4).toBeDefined() + expect(rng4.rng.name).toEqual('arc4') }) test('random seed consistency', () => {