lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


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