{"_id":"@acausal/random","name":"@acausal/random","dist-tags":{"alpha":"3.0.0-alpha.3","latest":"3.0.0-alpha.3"},"versions":{"3.0.0-alpha.3":{"name":"@acausal/random","version":"3.0.0-alpha.3","description":"Seeded PRNG (Mersenne Twister MT19937) with deterministic replay and zero dependencies","author":{"name":"David Robinson"},"license":"Apache-2.0","homepage":"https://github.com/abrisene/acausal/tree/main/packages/random","repository":{"type":"git","url":"git+https://github.com/abrisene/acausal.git","directory":"packages/random"},"bugs":{"url":"https://github.com/abrisene/acausal/issues"},"keywords":["random","prng","seeded","mersenne-twister","deterministic","rng","procedural-generation"],"type":"module","main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"devDependencies":{"tsup":"^8.2.4","typescript":"^5.6.3"},"scripts":{"build":"tsup","dev":"tsup --watch","typecheck":"tsc --noEmit","test":"vitest run"},"_id":"@acausal/random@3.0.0-alpha.3","_integrity":"sha512-pHaAIcXQJq3RI2UZLZpxy0HnfGFUbKhyFdi5SNXRGjSCykk14akLetbu3yMlbwSbrzxfEsSYf6fC46chysWLwg==","_resolved":"/tmp/acausal-alpha3-pnpm-test/acausal-random-3.0.0-alpha.3.tgz","_from":"file:/tmp/acausal-alpha3-pnpm-test/acausal-random-3.0.0-alpha.3.tgz","_nodeVersion":"24.14.0","_npmVersion":"11.13.0","dist":{"integrity":"sha512-pHaAIcXQJq3RI2UZLZpxy0HnfGFUbKhyFdi5SNXRGjSCykk14akLetbu3yMlbwSbrzxfEsSYf6fC46chysWLwg==","shasum":"6102a9dc6b3cb60f068b51d643dd10777642d50a","tarball":"https://registry.npmjs.org/@acausal/random/-/random-3.0.0-alpha.3.tgz","fileCount":9,"unpackedSize":53894,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQC1wDvxYRJWIVMkgICRU0mpLuLzweGFNeJPDMw2DxGcdgIhAKvfZit6s63zXb8fzMu5n2MbyZgSK+xhtEjRdEXTxHu3"}]},"_npmUser":{"name":"monetise","email":"dr@monetise.io"},"directories":{},"maintainers":[{"name":"monetise","email":"dr@monetise.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/random_3.0.0-alpha.3_1784578673690_0.39191915019208245"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-20T20:17:53.519Z","3.0.0-alpha.3":"2026-07-20T20:17:53.885Z","modified":"2026-07-20T20:17:54.136Z"},"maintainers":[{"name":"monetise","email":"dr@monetise.io"}],"description":"Seeded PRNG (Mersenne Twister MT19937) with deterministic replay and zero dependencies","homepage":"https://github.com/abrisene/acausal/tree/main/packages/random","keywords":["random","prng","seeded","mersenne-twister","deterministic","rng","procedural-generation"],"repository":{"type":"git","url":"git+https://github.com/abrisene/acausal.git","directory":"packages/random"},"author":{"name":"David Robinson"},"bugs":{"url":"https://github.com/abrisene/acausal/issues"},"license":"Apache-2.0","readme":"# @acausal/random\n\nSeeded PRNG (Mersenne Twister MT19937) with deterministic replay and zero dependencies.\n\n## Install\n\n```bash\nnpm install @acausal/random\n```\n\n## Usage\n\n```typescript\nimport { Random } from '@acausal/random';\n\nconst rng = new Random({ seed: 42 });\n\nrng.int(1, 6);              // deterministic d6 roll\nrng.real(0, 1);             // float in [0, 1)\nrng.bool(0.3);              // 30% chance of true\nrng.pick(['a', 'b', 'c']); // random element\nrng.pickWeighted({ common: 80, rare: 15, legendary: 5 });\n```\n\nSame seed always produces the same sequence. Serialize with `rng.serialize()` and restore with `new Random(dto)` to resume from any point.\n\nPart of the [acausal](https://github.com/abrisene/acausal) procedural generation toolkit.\n","readmeFilename":"README.md","_rev":"1-bdb5cd99740646217de84e3b41472125"}