草庐IT

bytesGenerated

全部标签

php - 在 PHP 中生成快速伪随机数据

我需要生成不可压缩的数据(因此是伪随机数据),并且一直在尝试使用下面的代码。但它只产生大约10MB/s的数据。我需要大约100-200MB/s。你有什么建议吗?if($length>8*1024*1024){//Defaultmaxstringlengthinphp.while(($length-$bytesGenerated)>8*1024*1024){$bytesGenerated=$bytesGenerated+(8*1024*1024);print(openssl_random_pseudo_bytes(8*1024*1024));}}print(openssl_random_