Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:97588 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 64993 invoked from network); 8 Jan 2017 17:29:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Jan 2017 17:29:24 -0000 Authentication-Results: pb1.pair.com header.from=lauri.kentta@gmail.com; sender-id=softfail Authentication-Results: pb1.pair.com smtp.mail=lauri.kentta@gmail.com; spf=softfail; sender-id=softfail Received-SPF: softfail (pb1.pair.com: domain gmail.com does not designate 178.62.210.197 as permitted sender) X-PHP-List-Original-Sender: lauri.kentta@gmail.com X-Host-Fingerprint: 178.62.210.197 k-piste.dy.fi Received: from [178.62.210.197] ([178.62.210.197:50332] helo=k-piste.dy.fi) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 72/29-31343-2F672785 for ; Sun, 08 Jan 2017 12:29:22 -0500 Received: from localhost.localdomain ([::1] helo=k-piste.dy.fi) by k-piste.dy.fi with esmtp (Exim 4.88) (envelope-from ) id 1cQHHS-0007HJ-Vm; Sun, 08 Jan 2017 19:29:18 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Sun, 08 Jan 2017 19:29:18 +0200 To: Yasuo Ohgaki Cc: internals@lists.php.net In-Reply-To: References: <7500b0c6a50baf49beac70ae01e8b50d@koti.fimnet.fi> Message-ID: X-Sender: lauri.kentta@gmail.com User-Agent: Roundcube Webmail/1.2.3 Subject: Re: [PHP-DEV] Use decent entropy for uniqid($prefix, TRUE) From: lauri.kentta@gmail.com (=?UTF-8?Q?Lauri_Kentt=C3=A4?=) On 2017-01-07 03:15, Yasuo Ohgaki wrote: > + php_random_int(1000000000, 9999999999, &rand, 1); > > This should be > > + php_random_int(0, 9999999999, &rand, 1); No, it shouldn't. That fixes none of the reported problems. You still have too many numbers (integer overflow) and still produce 0.abcdefgh instead of a.bcdefghi. If you can't fix it, maybe you shouldn't be doing it in the first place... -- Lauri Kenttä