Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:96510 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 43035 invoked from network); 20 Oct 2016 09:44:55 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Oct 2016 09:44:55 -0000 Authentication-Results: pb1.pair.com smtp.mail=yohgaki@ohgaki.net; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=yohgaki@ohgaki.net; 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:46083] helo=es-i.jp) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C9/53-24564-61298085 for ; Thu, 20 Oct 2016 05:44:55 -0400 Received: (qmail 130604 invoked by uid 89); 20 Oct 2016 09:44:51 -0000 Received: from unknown (HELO mail-qk0-f171.google.com) (yohgaki@ohgaki.net@209.85.220.171) by 0 with ESMTPA; 20 Oct 2016 09:44:51 -0000 Received: by mail-qk0-f171.google.com with SMTP id o68so82977082qkf.3 for ; Thu, 20 Oct 2016 02:44:49 -0700 (PDT) X-Gm-Message-State: AA6/9Rkn6WGirYO3J1B4hL6ibCYbh3Snl1x/cl3VtUSrrrMiJ/TMLOFIWz0I6nT0Rdtbnq5rx2PNtIQIUUmL7Q== X-Received: by 10.55.151.70 with SMTP id z67mr11688767qkd.185.1476956684053; Thu, 20 Oct 2016 02:44:44 -0700 (PDT) MIME-Version: 1.0 Received: by 10.140.22.38 with HTTP; Thu, 20 Oct 2016 02:44:03 -0700 (PDT) In-Reply-To: References: <070001d2295e$76b7d730$64278590$@belski.net> <075a01d22993$9efc6c80$dcf54580$@belski.net> <088801d229fa$d7320cb0$85962610$@belski.net> Date: Thu, 20 Oct 2016 18:44:03 +0900 X-Gmail-Original-Message-ID: Message-ID: To: Kalle Sommer Nielsen Cc: Anatol Belski , Joe Watkins , Niklas Keller , Leigh , PHP Internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] Re: [RFC][DISCUSSION] Improve uniqid() uniqueness From: yohgaki@ohgaki.net (Yasuo Ohgaki) Hi Kalle, I forgot to mention one more thing. On Thu, Oct 20, 2016 at 6:28 PM, Yasuo Ohgaki wrote: > Warnings are based on following facts. > > uniqid(); // without entropy > > usleep(1) is called to get unique timestamp, but NTP can disturb and > uniqid() can result in the same ID. > > uniqid('', TRUE); // with entropy > > It's better, but entropy is based on system timestamp and there is no > usleep(1), so uniqid() is more sensitive to system clock adjustment by > NTP, and uniqid() can result in the same ID. > > Collision is unlikely, but it not that unlikely with true CSPRNG based > entropy. Therefore, I made warning a little strong. With CSPRNG, we > may use more gentle warning. IMO. Application requires unique ID under across multi process/thread tasks, it will have more chance to have collided unique ID. Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net