[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Good random seeds.
- From: Jorge Visca <xxopxe@...>
- Date: Thu, 15 May 2008 14:03:37 -0300
Hi.
I was wondering what people use as seeds for the random generator.
os.time() seems ok, but the to-the-second precission and my usage
patterns make this a risky option. Not very probable, but when it
happens it means very weird behaviour.
I'm on linux, and the ideal would be lua only solution, with no extra
libraries. I could parse MAC adresses from runing "ifconfig", and hash
them. Or somehow get a number from /dev/urandom... Sadly, "date +%N"
doesn't work on my platform. Any ideas?
Jorge