Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:72816 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 52315 invoked from network); 26 Feb 2014 08:13:20 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Feb 2014 08:13:20 -0000 Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.213.48 as permitted sender) X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 209.85.213.48 mail-yh0-f48.google.com Received: from [209.85.213.48] ([209.85.213.48:64602] helo=mail-yh0-f48.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 18/7A-28538-E12AD035 for ; Wed, 26 Feb 2014 03:13:19 -0500 Received: by mail-yh0-f48.google.com with SMTP id z6so425187yhz.35 for ; Wed, 26 Feb 2014 00:13:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=LTxTWyfDdBuGGBwKnGBN2uPtwY7YU8BBgH61WiBAdEA=; b=N5JxV8IjR5H/opbniKDL5RQSQMC9r+xz8NUm6rqnVNYNbH2YmekTJ20XmdynOvtrMr NiXYMK1Y58Gk0ZA9c/L//LgGyQbwK77XA6XrPb0RPDjN+CkH3WPTWEWWRL/vCQTlmQDX XcyfaJjXrHmXV9Oq6z5ie+2FKIa0KJ5hUa2hXsMhMeSA/k+wIDuDORED/NfGaDInYWuj 16ASnwgt7pfwii1eNx/RHBhXneqT9mn6NRm2ho0sa0yK1apVjeF/oF5vvZRvIo7z3rH3 bjbqcZpGg15Xj42lh2iTAXw3v5it5kOyppFLxF0KOqSGt7sQxZeSvUCNPdS7xcx/uNrQ EJDQ== MIME-Version: 1.0 X-Received: by 10.236.100.235 with SMTP id z71mr5689825yhf.43.1393402396665; Wed, 26 Feb 2014 00:13:16 -0800 (PST) Received: by 10.170.218.65 with HTTP; Wed, 26 Feb 2014 00:13:16 -0800 (PST) In-Reply-To: References: Date: Wed, 26 Feb 2014 09:13:16 +0100 Message-ID: To: =?UTF-8?Q?Rouven_We=C3=9Fling?= Cc: PHP internals Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] [PHP6] Merging rand and mt_rand() From: pierre.php@gmail.com (Pierre Joye) Hi Rowen, On Sun, Feb 23, 2014 at 7:45 PM, Rouven We=C3=9Fling = 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-s= ecure random number generation. Here is not so much security at stake but e= ase 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? I totally agree with your goals. There are too many ways to do the same operations, in many areas. However I am not a fan of breaking BC (even in small ways) without an actual big benefit. It is always easy to remove, kill, change functions to make them "better". Adding each single change together will make a migration to a given version almost impossible or very painful. I would go with a soft way. In the case of the random functions, as I said in previous discussions, I tend to go with a new APIs, clean, with a couple more algorithms as well as easy to use functions for the common usages (crypto safe or not). Anthony implemented something in userland, there are a couple of libraries available too (in C, used by python f.e.) providing very handy APIs. That's the way I would choose. Cheers, --=20 Pierre @pierrejoye | http://www.libgd.org