Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:31057 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 21347 invoked by uid 1010); 18 Jul 2007 18:20:51 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 21332 invoked from network); 18 Jul 2007 18:20:51 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Jul 2007 18:20:51 -0000 Authentication-Results: pb1.pair.com header.from=webmaster@keryx.se; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=webmaster@keryx.se; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain keryx.se designates 208.69.121.33 as permitted sender) X-PHP-List-Original-Sender: webmaster@keryx.se X-Host-Fingerprint: 208.69.121.33 supavet.nexcess.net Received: from [208.69.121.33] ([208.69.121.33:40442] helo=supavet.nexcess.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 9F/96-01090-FF95E964 for ; Wed, 18 Jul 2007 14:20:49 -0400 Received: (qmail 9266 invoked by uid 108); 18 Jul 2007 18:20:44 -0000 Received: from unknown (HELO ?127.0.0.1?) (gunther@keryx.se@87.227.57.139) by supavet.nexcess.net with ESMTPA; 18 Jul 2007 18:20:44 -0000 Message-ID: <469E59FA.6060104@keryx.se> Date: Wed, 18 Jul 2007 20:20:42 +0200 User-Agent: Thunderbird 2.0.0.4 (Windows/20070604) MIME-Version: 1.0 To: internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Antivirus: avast! (VPS 000757-3, 2007-07-17), Outbound message X-Antivirus-Status: Clean Subject: libc and random functions From: webmaster@keryx.se (Keryx Web) I do not know if this post made it to the list a while ago. No one answered and i see I used the wrong account to send it. Please forgive me if this is a redundant re-post. This is a suggestion I think would not be too hard to implement: Skip libc for all random functions. As I see it there is no reason to keep it. I can't think of any application that would break if rand() would produce better random results at a higher speed. So basically what I am saying is this: Implement the mersenne twister in the back of all random functions. 1. Make rand() an alias to mt_rand() 2. Make srand() an alias to mt_srand() (And since they are redundant give an E_STRICT?) 3. Make getrandmax() an alias to mt_getrandmax() 4. Have array_rand() implement MT in the back (if it is not doing so already) Lars Gunther P.S. For an introduction to who I am one might read: http://www.webstandards.org/action/edutf/interviews/gunther-en/ and look at http://www.flickr.com/photos/keryxgunther/143376264/