Re: [PHP6] Merging rand and mt_rand()

From: Date: Mon, 24 Feb 2014 19:23:20 +0000
Subject: Re: [PHP6] Merging rand and mt_rand()
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-72798@lists.php.net to get a copy of this message
Am 23.02.2014 20:08, schrieb Nikita Popov: > On Sun, Feb 23, 2014 at 7:45 PM, Rouven Weßling <me@rouvenwessling.de>wrote: > >> Hello internals, >> >> there has already been a lot of talk about improving secure random number >> generation for PHP6. One thing I'd like to improve as well, would be >> non-secure random number generation. Here is not so much security at stake >> but ease of use. >> >> The obvious solution, would be to rename mt_rand to rand and make rand an >> alias. (The same for the supporting functions mt_srand and mt_getrandmax). >> >> What I'm missing is the history. What was the reason to keep the separate? >> Am I missing something? >> >> Best regards >> Rouven >> > Changing the random number generation algorithm is a BC break, e.g. tests > could rely on certain random number sequences for a certain seed. However > it sounds reasonable to make rand, array_shuffle, str_shuffle etc make use > of MT 19937 in PHP6, as we have a bit more freedom with breakage. > > Nikita I already wrote down an idea for a very simple bc-safe API: http://grokbase.com/t/php/php-internals/138wn1sy5g/more-powerful-and-backward-compatible-api-of-random-number-generator-functions (Can't find the direct link to http://news.php.net/php.internals/????) Marc

« previous php.internals (#72798) next »