mirror of
https://github.com/librespeed/speedtest.git
synced 2024-05-10 18:54:52 +00:00
Use random_bytes when available (#487)
This commit is contained in:
@ -53,7 +53,11 @@ function sendHeaders()
|
||||
$chunks = getChunkCount();
|
||||
|
||||
// Generate data
|
||||
$data = openssl_random_pseudo_bytes(1048576);
|
||||
if (function_exists('random_bytes')) {
|
||||
$data = random_bytes(1048576);
|
||||
} else {
|
||||
$data = openssl_random_pseudo_bytes(1048576);
|
||||
}
|
||||
|
||||
// Deliver chunks of 1048576 bytes
|
||||
sendHeaders();
|
||||
|
Reference in New Issue
Block a user