Creates a linear feedback shift register (LFSR). Useful for creating deterministic, pseudo-random numbers.
Uses 0 (inclusive)...1 (exclusive) scale like Math.random();
// Get a function to produce sclar (0..1) values:const l = lfsrSource();// Produce a valuel(); // 0..1 value Copy
// Get a function to produce sclar (0..1) values:const l = lfsrSource();// Produce a valuel(); // 0..1 value
By default, lfsrSource uses a fixed seed, so each time it creates the same series of random numbers.
lfsrSource
Custom seed
const l = lfsrSource({ seed: 0b10111101 }); Copy
const l = lfsrSource({ seed: 0b10111101 });
The algorithm natively produces integer values which are scaled to 0..1 range. If you want integer results:
const l = lfsrSource({ output: `integer` }); Copy
const l = lfsrSource({ output: `integer` });
Note: not very high-resolution.
Creates a linear feedback shift register (LFSR). Useful for creating deterministic, pseudo-random numbers.
Uses 0 (inclusive)...1 (exclusive) scale like Math.random();
By default,
lfsrSourceuses a fixed seed, so each time it creates the same series of random numbers.Custom seed
The algorithm natively produces integer values which are scaled to 0..1 range. If you want integer results:
Note: not very high-resolution.