Advertisement
Guest User

Untitled

a guest
Sep 2nd, 2015
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.56 KB | None | 0 0
  1. <?
  2. function generate($mask,$count_chars,$current_string="",$current_chars=0)
  3. {
  4. if(strlen($current_string) < $current_chars+1)
  5. $current_string .= " ";//дополняем текущую строку новым сиволом если не хватает
  6.  
  7. $masc_count = count($mask);
  8. for($i=0;$i<=$masc_count;$i++)
  9. {
  10. $current_string[$current_chars] = $mask[$i];//задаём символ на каждой интерации
  11. if($count_chars < $count_chars)//записывать будет только последняя функция в стеке
  12. generate($mask,$count_chars,$current_string,$current_chars+1);
  13. else
  14. {
  15. $url = 'http://'.$current_string.'.asuscomm.com';
  16. //if(curl($url))
  17. // file_put_contents('curva.txt',$url."\r\n",FILE_APPEND);
  18. }
  19. }
  20. }
  21. $mask = "qwertyuiopasdfghjklzxcvbnm1234567890";
  22.  
  23. $time1 = microtime(true);
  24.  
  25. generate($mask,9);
  26.  
  27. $time2 = microtime(true);
  28.  
  29. $count = count($mask);
  30. for($i1=0; $i1 < $count; $i1++)
  31. for($i2=0; $i2 < $count; $i2++)
  32. for($i3=0; $i3 < $count; $i3++)
  33. for($i4=0; $i4 < $count; $i4++)
  34. for($i5=0; $i5 < $count; $i5++)
  35. for($i6=0; $i6 < $count; $i6++)
  36. for($i7=0; $i7 < $count; $i7++)
  37. for($i8=0; $i8 < $count; $i8++)
  38. for($i9=0; $i9 < $count; $i9++)
  39. $url = 'http://'.$mask[$i1].$mask[$i2].$mask[$i3].$mask[$i4].$mask[$i5].$mask[$i6].$mask[$i7].$mask[$i8].$mask[$i9].'.asuscomm.com';
  40.  
  41. $time3 = microtime(true);
  42.  
  43. echo 'Ivan\'s result is ' . ($time2-$time1)*1000000 . '; my result is ' . ($time3-$time2)*1000000;
  44.  
  45. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement