Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.82 KB | None | 0 0
  1. <?php
  2.  
  3. $errorcount = 0;
  4.  
  5. for ($i = 0; $i < 100000; $i++) {
  6.     if ($i%1000==0) echo $i, "\n";
  7.     $pepper = md5(mt_rand(0,10000000));
  8.    
  9.     $username = substr(md5($pepper),0,5);
  10.     $id       = uniqid(null,true);
  11.    
  12.     try {
  13.         $cursor = $users->insert(array(
  14.             'id' => $id,
  15.             'account' => array(
  16.                 'username'    => $username,
  17.                 'active'      => true,
  18.                 'password'    => sha1("test123"+$pepper+$salt),
  19.                 'pepper'      => $pepper,
  20.                 'cryptmethod' => 'sha1sp'
  21.             ),
  22.             'profile' => array(
  23.                 'username'    => md5($pepper),
  24.                 'biography'   => "Some random user",
  25.                 'birthdate'   => date('Y-m-d',strtotime(mt_rand(1960,2000).'-'.mt_rand(1,12).'-'.mt_rand(1,28))),
  26.             )
  27.         ),array('safe'=>true));
  28.     } catch(Exception $e) {
  29.         $errorcount++;
  30.     }
  31.    
  32.     unset($findJs);
  33.     unset($id);
  34.     unset($username);
  35.     unset($pepper);
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement