Implementation of java.lang.Random in PHP and C
- by justinhj
I'm looking for a random number generator that I can run in PHP, C and Java that will always return the same sequence of numbers for a given seed.
Here's the Java implementation I would use: java.util.random source
Whilst this would be fairly straightforward to port to C and PHP, there is potentially a lot of work to get all the edge cases correct and handle differences in number representation. I'd be extremely happy to just copy and paste a fully tested version should it exist.