[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Getting randomic integers
- From: startx <startx@...>
- Date: Sun, 17 Jan 2010 10:15:41 +0000
On Sun, 17 Jan 2010 01:58:25 -0800
Majic <majic.one@gmail.com> wrote:
> Thanks for the tips, very helpful :)))))
i was just wondering, what if someone does something like this:
local devrandom = io.open("/dev/urandom","r")
local size = 64
local seed = devrandom:read(size)
devrandom:close()
math.randomseed(string.byte(seed))
print(math.random(100))
you could even use /dev/random if your systenm is busy enough to have a
sufficient feed for /dev/random, or am i completely wrong here?
startx