Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:95973 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 6840 invoked from network); 13 Sep 2016 06:23:59 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Sep 2016 06:23:59 -0000 Authentication-Results: pb1.pair.com smtp.mail=oishi@giraffy.jp; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=kazuo@o-ishi.jp; sender-id=pass Received-SPF: pass (pb1.pair.com: domain giraffy.jp designates 49.212.134.110 as permitted sender) X-PHP-List-Original-Sender: oishi@giraffy.jp X-Host-Fingerprint: 49.212.134.110 www7096uf.sakura.ne.jp Received: from [49.212.134.110] ([49.212.134.110:53168] helo=xii.giraffy.jp) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D6/B7-60695-D7B97D75 for ; Tue, 13 Sep 2016 02:23:57 -0400 Received: from localhost (localhost [127.0.0.1]) by xii.giraffy.jp (Postfix) with ESMTP id 4BE1D7A80BC; Tue, 13 Sep 2016 15:23:54 +0900 (JST) X-Virus-Scanned: amavisd-new at giraffy.jp Received: from xii.giraffy.jp ([127.0.0.1]) by localhost (xii.giraffy.jp [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6IGh4f3L04i3; Tue, 13 Sep 2016 15:23:47 +0900 (JST) Received: from lil.giraffy.jp (aa024044.ppp.asahi-net.or.jp [110.5.24.44]) by xii.giraffy.jp (Postfix) with ESMTPSA id D40677A80A0; Tue, 13 Sep 2016 15:23:47 +0900 (JST) To: Yasuo Ohgaki Cc: "internals\@lists.php.net" In-Reply-To: (Yasuo Ohgaki's message of "Tue, 13 Sep 2016 14:45:35 +0900") References: <878tuxenl4.fsf@lil.giraffy.jp> <87twdlcs2j.fsf@lil.giraffy.jp> <87h99lch13.fsf@lil.giraffy.jp> <877fagczci.fsf@lil.giraffy.jp> <87mvjcbfcb.fsf@lil.giraffy.jp> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) Date: Tue, 13 Sep 2016 15:23:47 +0900 Message-ID: <877fagwc5o.fsf@lil.giraffy.jp> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [PHP-DEV] [RFC][DISCUSSION] Improve uniqid() uniqueness From: kazuo@o-ishi.jp (Kazuo Oishi) Hi, >> The uniqid() manual explicitly say, >> >> - default value of more_entropy is false >> >> - the returned string will be 13 characters long. If more_entropy is >> TRUE, it will be 23 characters. >> >> - if more_entropy is set to TRUE, uniqid() will add additional entropy >> (using the combined linear congruential generator) at the end of the >> return value >> >> http://php.net/manual/en/function.uniqid.php .... > It's legacy design. > > php_combined_lcg() must not be used, especially functions like > uniqid(). i.e. It's supposed to generate unique ID based on time, but > php_combined_lcg() generates pseudo random from current time. > > It's more than obvious it's legacy and obsolete today. I agree that uniqid() is legacy design API. And, > Current implementation is good enough for most cases, but it can be better. I agree this legacy design API works good enough for most cases. So, I think it should not be changed in BC break way. -- Kazuo Oishi