So, to test how unique they are, I'm trying to write a script that will "crack" the filename if you will.
What I'm doing is putting a bunch of letters and numbers into an array, using shuffle() to randomize them, pull out a set number of letters and numbers, and then run it through a huge while loop.
Here's an example (a basic one so you can get the idea)
Code: Select all
$user = "joebob";
$dir = "http://www.domain.com/picdir/$user";
$array = array("1","2","3");
for($i=0; $i<99999999; $i++)
{
shuffle($array);
$rand = $array[1].$array[2].$array[3];
$pic = $dir.$rand.".jpg";
if(@getimagesize($pic))
{
// show picture
}
}And #2, is there anything faster than getimagesize() for testing purposes? Running that loop takes a while. I've tried if(file_exists()), but it does't seem to work with URLs.