Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:43253 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 30476 invoked from network); 4 Mar 2009 15:28:55 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Mar 2009 15:28:55 -0000 Authentication-Results: pb1.pair.com smtp.mail=et@php.net; spf=unknown; sender-id=unknown Authentication-Results: pb1.pair.com header.from=et@php.net; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 130.83.156.225 as permitted sender) X-PHP-List-Original-Sender: et@php.net X-Host-Fingerprint: 130.83.156.225 lnx500.hrz.tu-darmstadt.de Received: from [130.83.156.225] ([130.83.156.225:45938] helo=lnx500.hrz.tu-darmstadt.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 02/D0-25985-53E9EA94 for ; Wed, 04 Mar 2009 10:28:55 -0500 Received: from fire02.rbg.informatik.tu-darmstadt.de (fire02.rbg.informatik.tu-darmstadt.de [130.83.160.8]) by lnx500.hrz.tu-darmstadt.de (8.13.8/8.13.8/HRZ/PMX) with ESMTP id n24FSodJ002316; Wed, 4 Mar 2009 16:28:50 +0100 (envelope-from et@php.net) Received: from mail.rbg.informatik.tu-darmstadt.de (localhost [127.0.0.1]) by fire02.rbg.informatik.tu-darmstadt.de (8.13.8+Sun/8.13.8) with ESMTP id n24FSoVF025800; Wed, 4 Mar 2009 16:28:50 +0100 (MET) Received: from [10.162.96.15] ([10.162.96.15]) (authenticated bits=0) by mail.rbg.informatik.tu-darmstadt.de (8.14.3/8.14.3) with ESMTP id n24FSndq025797 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Wed, 4 Mar 2009 16:28:50 +0100 (MET) Cc: Pierre Joye , PHP internals Message-ID: <10AC7A40-1A8B-46E0-A27D-96A2EA97A077@php.net> To: Kenan Sulayman In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v930.3) Date: Wed, 4 Mar 2009 16:28:49 +0100 References: X-Mailer: Apple Mail (2.930.3) X-PMX: seen v0.51 X-PMX-SPAMCHECK: outgoing mail: not checked Subject: Re: [PHP-DEV] Really random ? From: et@php.net (Stefan Walk) On 4 Mar 2009, at 15:46, Kenan Sulayman wrote: > Hey Pierre! > > Didn't I included the mt_rand function in my tests ? > > Quote: "Average of mersenne twister in 8016909 it's is > 1073848211.4106 ( > corresponding to that in 8503575 it's the avg. is 1073904131.0286)." > > The mail was meant to make the rand(x) function more good; > I already use the mt_rand() function, but why should the rand(x) > function > still be used, if it's so freakin' insecure ? I hope that by "insecure" you don't imply that you're using those pseudorandom generators for cryptography purposes. As the manual states, rand() uses the libc rand(), which can be desirable if you want to generate the same sequence of numbers across languages. And you don't need to complain about its drawbacks, because they are well- known (see ). If you want "secure" random numbers, use something that at least tries to utilize "real" entropy. But that topic has nothing to do with the development of PHP ... Regards, Stefan