Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:97596 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 84771 invoked from network); 8 Jan 2017 21:09:10 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Jan 2017 21:09:10 -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:57022] helo=es-i.jp) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id FE/9C-31343-47AA2785 for ; Sun, 08 Jan 2017 16:09:10 -0500 Received: (qmail 62114 invoked by uid 89); 8 Jan 2017 21:09:04 -0000 Received: from unknown (HELO mail-wm0-f52.google.com) (yohgaki@ohgaki.net@74.125.82.52) by 0 with ESMTPA; 8 Jan 2017 21:09:04 -0000 Received: by mail-wm0-f52.google.com with SMTP id k184so96284490wme.1 for ; Sun, 08 Jan 2017 13:09:04 -0800 (PST) X-Gm-Message-State: AIkVDXJQLAKP3ZJ/v576KVCkK0SqF8v/hUVCHF52T7MH81D+weyOMblgQNKufuaa3UPkcFDZNYdTI6biPmcojw== X-Received: by 10.223.160.172 with SMTP id m41mr9171766wrm.116.1483909737707; Sun, 08 Jan 2017 13:08:57 -0800 (PST) MIME-Version: 1.0 Received: by 10.195.12.8 with HTTP; Sun, 8 Jan 2017 13:08:17 -0800 (PST) In-Reply-To: References: <7500b0c6a50baf49beac70ae01e8b50d@koti.fimnet.fi> Date: Mon, 9 Jan 2017 06:08:17 +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=001a114e3092cb80d405459ba8fa Subject: Re: [PHP-DEV] Use decent entropy for uniqid($prefix, TRUE) From: yohgaki@ohgaki.net (Yasuo Ohgaki) --001a114e3092cb80d405459ba8fa Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Mon, Jan 9, 2017 at 5:07 AM, Yasuo Ohgaki wrote: > 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 >> 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.= .. > > > Did you read my mail? > Please read mail again. > Anyway, I agree your way is optimal for 9 digit chars entropy. I don't care about extending entropy strength, longer length and use of non digits, for now. Are we OK with the patch Lauri proposed? Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net --001a114e3092cb80d405459ba8fa--