title: Generate fast pseudorandom data in PHP
body: <p>I need to generate uncompressible data (therefore pseudorandom), and have been trying with the code below. But it's only producing about 10MB/s of data. I need about 100-200 MB/s.
  Do you have any advice?</p>
  
  <pre><code>if ($length &gt; 8*1024*1024){ //Default max string length in php.
      while (($length - $bytesGenerated)&gt;8*1024*1024){
          $bytesGenerated = $bytesGenerated + (8*1024*1024);
          print(openssl_random_pseudo_bytes(8*1024*1024));
      }
  }
  print(openssl_random_pseudo_bytes($length - $bytesGenerated));
  </code></pre>