Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:97592 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 76602 invoked from network); 8 Jan 2017 20:08:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Jan 2017 20:08:29 -0000 Authentication-Results: pb1.pair.com header.from=yohgaki@ohgaki.net; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=yohgaki@ohgaki.net; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ohgaki.net designates 180.42.98.130 as permitted sender) X-PHP-List-Original-Sender: yohgaki@ohgaki.net X-Host-Fingerprint: 180.42.98.130 ns1.es-i.jp Received: from [180.42.98.130] ([180.42.98.130:56730] helo=es-i.jp) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 13/0B-31343-C3C92785 for ; Sun, 08 Jan 2017 15:08:29 -0500 Received: (qmail 52628 invoked by uid 89); 8 Jan 2017 20:08:24 -0000 Received: from unknown (HELO mail-wm0-f49.google.com) (yohgaki@ohgaki.net@74.125.82.49) by 0 with ESMTPA; 8 Jan 2017 20:08:24 -0000 Received: by mail-wm0-f49.google.com with SMTP id c85so79587964wmi.1 for ; Sun, 08 Jan 2017 12:08:23 -0800 (PST) X-Gm-Message-State: AIkVDXKoiKpZpV+vrqnZKIYtQdFSpIKtSuUcWMr/HXACcCC34IZDISJONUC0yYLBifVRfH9Y6WPdSla7gUy1rg== X-Received: by 10.28.9.131 with SMTP id 125mr3030042wmj.22.1483906096719; Sun, 08 Jan 2017 12:08:16 -0800 (PST) MIME-Version: 1.0 Received: by 10.195.12.8 with HTTP; Sun, 8 Jan 2017 12:07:35 -0800 (PST) In-Reply-To: References: <7500b0c6a50baf49beac70ae01e8b50d@koti.fimnet.fi> Date: Mon, 9 Jan 2017 05:07:35 +0900 X-Gmail-Original-Message-ID: Message-ID: To: =?UTF-8?Q?Lauri_Kentt=C3=A4?= Cc: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=001a114423e8c6764605459acf0e Subject: Re: [PHP-DEV] Use decent entropy for uniqid($prefix, TRUE) From: yohgaki@ohgaki.net (Yasuo Ohgaki) --001a114423e8c6764605459acf0e Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Mon, Jan 9, 2017 at 2:29 AM, Lauri Kentt=C3=A4 = wrote: > 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 hav= e > 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..= . Did you read my mail? Please read mail again. Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net --001a114423e8c6764605459acf0e--