ISAAC Random Number Generator
This node generates cryptographically secure pseudorandom numbers using the ISAAC algorithm.
The ISAAC RNG node provides high-quality random numbers suitable for simulation and cryptography.
The ISAAC Random Number Generator node uses the ISAAC (Indirection, Shift, Accumulate, Add, and Count) algorithm to produce high-quality random numbers. Unlike standard Math.random(), ISAAC is cryptographically secure and can be seeded for deterministic reproducibility.
Inputs
Configuration
| Data | Description |
|---|---|
| Seed | A number to seed the generator. If provided, the sequence of random numbers will be deterministic (same seed = same sequence). |
| Nonce | An additional number to mix into the state. Useful for varying the sequence even with the same seed. |
Actions
| Signal | Description |
|---|---|
| Do | Generates the next random number in the sequence. |
Outputs
Data
| Data | Description |
|---|---|
| Generated Value | The generated random number (float between 0 and 1, scaled to internal max). |
Signals
| Signal | Description |
|---|---|
| Done | Triggered when the value has been generated. |
Usage
Use this node when you need high-quality randomness or reproducible random sequences (e.g., for procedural generation or replay systems).
Example Use Cases
- Procedural Generation: Generate a game world. Using a specific
Seedallows players to share world seeds. - Simulation: Run deterministic simulations where you need to repeat the exact same random events for debugging.
- Cryptography: Generating secure tokens or keys (though specialized nodes are often better for this).
Detailed Behavior
- Seeding:
- If
Seedis provided, the generator initializes with that state. - Changing the
SeedorNonceresets the generator. - If no seed is provided, it uses
Date.now()andMath.random()for entropy.
- If
- Algorithm:
- ISAAC is designed to be fast (avg 18.75 instructions per 32-bit value) and secure (cycle length 2^8295).
- It produces uniformly distributed results.
Troubleshooting
- Same Value Repeated: If you are setting the Seed immediately before every "Do", you might be resetting the generator constantly. Set the Seed once, then trigger "Do" multiple times to get the sequence.
Was this page helpful?