kickstart Posted September 17, 2009 Share Posted September 17, 2009 Hi Are the processes running on different servers? How are the processes split up (ie, are they several processes fired off simultaneously). Is there a specific range of ip addresses (presume you are not interested in every IP going)? If you had (say) 256 processes, then each one could have one of one group of IP addresses leaving them each just to store the ints output as a medium int (ie, 3 byte integer, enough to store 3 parts of the ip address). Or doing something similar with 2 of the groups of IP numbers. All the best Keith Quote Link to comment https://forums.phpfreaks.com/topic/174481-rand-and-mt_rand-arent-random-on-win32/page/2/#findComment-920311 Share on other sites More sharing options...
Daniel0 Posted September 17, 2009 Share Posted September 17, 2009 IP address is just 4 numbers each from 0 to 255, so just really a 4 byte unsigned integer (or 4 unsigned tinyints). No, an IP address is one 32-bit unsigned integer. The dotted notation is for humans, not computers. So to get a random IP address you just generate a random number lower than 4294967296 and convert it to dotted format. Quote Link to comment https://forums.phpfreaks.com/topic/174481-rand-and-mt_rand-arent-random-on-win32/page/2/#findComment-920312 Share on other sites More sharing options...
RussellReal Posted September 17, 2009 Share Posted September 17, 2009 <?php $r = range(0,100000); shuffle($r); $randNumber = array_pop($r); ?> Quote Link to comment https://forums.phpfreaks.com/topic/174481-rand-and-mt_rand-arent-random-on-win32/page/2/#findComment-920374 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.