Use built-in random_bytes functionality

This commit is contained in:
Tux
2016-08-19 10:40:12 -04:00
committed by Dylan K. Taylor
parent b16f7e4dd5
commit 8e9a078ff9
5 changed files with 12 additions and 104 deletions

View File

@ -1056,7 +1056,7 @@ class Server{
return false;
}
$seed = $seed === null ? Binary::readInt(@Utils::getRandomBytes(4, false)) : (int) $seed;
$seed = $seed === null ? Binary::readInt(random_bytes(4)) : (int) $seed;
if(!isset($options["preset"])){
$options["preset"] = $this->getConfigString("generator-settings", "");
@ -1452,7 +1452,7 @@ class Server{
"level-type" => "DEFAULT",
"enable-query" => true,
"enable-rcon" => false,
"rcon.password" => substr(base64_encode(@Utils::getRandomBytes(20, false)), 3, 10),
"rcon.password" => substr(base64_encode(random_bytes(20)), 3, 10),
"auto-save" => true,
]);