Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:95982 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 34500 invoked from network); 13 Sep 2016 11:11:09 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Sep 2016 11:11:09 -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:39859] helo=es-i.jp) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id ED/9C-60695-ACED7D75 for ; Tue, 13 Sep 2016 07:11:09 -0400 Received: (qmail 114598 invoked by uid 89); 13 Sep 2016 11:11:03 -0000 Received: from unknown (HELO mail-qk0-f170.google.com) (yohgaki@ohgaki.net@209.85.220.170) by 0 with ESMTPA; 13 Sep 2016 11:11:03 -0000 Received: by mail-qk0-f170.google.com with SMTP id z190so160605243qkc.3 for ; Tue, 13 Sep 2016 04:11:02 -0700 (PDT) X-Gm-Message-State: AE9vXwN7mHsHBWBXoGMgo6HtVkwODlkb5RsuWgtQj3g2PIPsf0ez+wPvBakzNIZ+uDh300bEClPqD+RbjVZoVg== X-Received: by 10.55.184.198 with SMTP id i189mr190227qkf.96.1473765053666; Tue, 13 Sep 2016 04:10:53 -0700 (PDT) MIME-Version: 1.0 Received: by 10.140.84.168 with HTTP; Tue, 13 Sep 2016 04:10:13 -0700 (PDT) In-Reply-To: <206179c0-326f-70b4-a14d-afa0859bbc66@gmail.com> References: <878tuxenl4.fsf@lil.giraffy.jp> <87twdlcs2j.fsf@lil.giraffy.jp> <6370f3c9-0904-bac9-0f9e-e563e9af9843@gmail.com> <206179c0-326f-70b4-a14d-afa0859bbc66@gmail.com> Date: Tue, 13 Sep 2016 20:10:13 +0900 X-Gmail-Original-Message-ID: Message-ID: To: Rowan Collins Cc: "internals@lists.php.net" Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] [RFC][DISCUSSION] Improve uniqid() uniqueness From: yohgaki@ohgaki.net (Yasuo Ohgaki) Hi Rowan, On Tue, Sep 13, 2016 at 6:47 PM, Rowan Collins wrote: > To me, uniqid() is useful because it is a quick way of getting a short > string that's likely to be fairly unique. If that is its purpose, then > making it slower, and its output longer, are not helping anybody. > > If it's purpose is to be truly random, and have controllable entropy, etc, > then we might as well deprecate it in favour of random_bytes(). Reasonable. Then enable more entropy and use php_random_byte() for it. Question is what format: - the same as now (digits and .) - convert alphanumeric [0-v] - convert to hex [0-f] Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net