View Single Post
Old 03-16-2009, 05:45 AM  
Libertine
sex dwarf
 
Libertine's Avatar
 
Join Date: May 2002
Posts: 17,860
Quote:
Originally Posted by grumpy View Post
you dont need the mt_srand ((double) microtime() * 1000000);
Its build in in the mt_rand
Yep. As of 4.2, seeding is no longer needed, if I recall correctly.

mt_rand() will do for most purposes, but if you need pseudo-random data for purposes related to cryptography, keep in mind that mt_rand uses a mersenne twister, which is rather weak. So, in those cases, getting your pseudo-random data from /dev/urandom is a better option.
__________________
/(bb|[^b]{2})/
Libertine is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote