@libraz/libcantus - v0.9.3
    Preparing search index...

    Function createRng

    • Create a seeded PRNG (mulberry32) exposing the shared samplers.

      Parameters

      • seed: number

        The 32-bit seed; the same seed always yields the same stream.

      Returns Rng

      The seeded generator.

      import { createRng } from '@libraz/libcantus';
      const rng = createRng(42);
      rng.next(); // deterministic float in [0, 1)
      rng.range(1, 6); // deterministic integer in [1, 6]