Generate fast pseudorandom data in PHP

izme0069

New Member
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?\[code\]if ($length > 8*1024*1024){ //Default max string length in php. while (($length - $bytesGenerated)>8*1024*1024){ $bytesGenerated = $bytesGenerated + (8*1024*1024); print(openssl_random_pseudo_bytes(8*1024*1024)); }}print(openssl_random_pseudo_bytes($length - $bytesGenerated));\[/code\]
 
Back
Top