Konstantin Olkhovskiy wrote: > I though of tonumber(<int64_t cdata>), but my concern is about roundings > and other floating point machinery that can kick in. Nope, that operation is completely predictable. Ok, so it throws away a couple of bits, of course. But then ... there's no guarantee that different seeds will generate a different sequence, anyway. For your use case it might be best to use a dedicated PRNG that isn't global like math.random(). Then you have full control over the seeding process etc. Most PRNGs can be implemented quite efficiently with the FFI and the 64 bit bit operations available in LuaJIT 2.1. Or you could just call an existing C implementation via the FFI. --Mike