On 09.09.2016 at 07:12, Yasuo Ohgaki wrote: > We all know, uniqid() is not unique at all and not safe as random ID > at all. This would be one of the most misused function because of its > name.
uniqid() yields truly unique values for a single machine (except for CYGWIN, and potentially older Windows versions), if $more_entropy is FALSE[1]. Of course, the function shouldn't be used for any crypto purposes, but it is fine to get a unique ID if you have no database that delivers a sequential index number (aka. autoincrement field), for instance. [1] <https://github.com/php/php-src/blob/PHP-7.0.11/ext/standard/uniqid.c#L68> -- Christoph M. Becker -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php