PRNG provides simple random number generators for testing.
Usage:
// create a new LCG generator
lcg32 := prng.LCG32(0)
// roll 5 6-sided dice
r1 := sfc32.Roll(5, 6)
// create a new SFC generator
sfc32 := prng.SFC32(0, 12345, 0, 1)
// roll 5 6-sided dice
r2 := sfc32.Roll(5, 6)
- 32-bit generators
- LCG and SFC implementations
No installation required - just import the package into your program.
import github.com/mdhender/prng
- Issue Tracker: github.com/mdhender/prng/issues
- Source Code: github.com/mdhender/prng
If you are having issues, please let us know.
The project is licensed under the MIT license.
Special thanks to Eric Holscher and Write The Docs.
Constants for LCG32 from Open Adventure.
Code for SFC32 is from SimBlob.