Re: Getting randomic integers
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Getting randomic integers
- From: startx <startx@...>
- Date: 2010年1月17日 10:15:41 +0000
On 2010年1月17日 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