From 085d1a13599b1fc84ecf397a966f618b59563c49 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Wed, 11 Jan 2017 11:53:54 +0000 Subject: [PATCH] Remove deprecated Utils::getRandomBytes() --- src/pocketmine/utils/Utils.php | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/src/pocketmine/utils/Utils.php b/src/pocketmine/utils/Utils.php index 7d40b427b..d64a42701 100644 --- a/src/pocketmine/utils/Utils.php +++ b/src/pocketmine/utils/Utils.php @@ -334,30 +334,6 @@ class Utils{ return preg_replace('#([^\x20-\x7E])#', '.', $str); } - /** - * This function tries to get all the entropy available in PHP, and distills it to get a good RNG. - * - * This function simply forwards to the PHP random_bytes function. - * - * @param int $length default 16, Number of bytes to generate - * @param bool $secure default true, Generate secure distilled bytes, slower - * @param bool $raw default true, returns a binary string if true, or an hexadecimal one - * @param string $startEntropy default null, adds more initial entropy - * @param int &$rounds Will be set to the number of rounds taken - * @param int &$drop Will be set to the amount of dropped bytes - * - * @deprecated prefer PHP 7 random_bytes() - * @return string - */ - public static function getRandomBytes($length = 16, $secure = true, $raw = true, $startEntropy = "", &$rounds = 0, &$drop = 0){ - $raw_output = random_bytes($length); - if($raw){ - return $raw_output; - }else{ - return bin2hex($raw_output); - } - } - /* public static function angle3D($pos1, $pos2){ $X = $pos1["x"] - $pos2["x"];