php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #50471 uniqid example is bad
Submitted: 2009-12-14 17:28 UTC Modified: 2009-12-25 00:24 UTC
From: emery dot denuccio at gmail dot com Assigned: kalle (profile)
Status: Closed Package: Documentation problem
PHP Version: 5.3.1 OS: Mac
Private report: No CVE-ID: None
 [2009-12-14 17:28 UTC] emery dot denuccio at gmail dot com
Description:
------------
As many people have pointed out in the comments, MD5 hashing a UUID 
simply reduces the randomness due to collisions. The example is 
pointless / less secure.

Reproduce code:
---------------
---
From manual page: function.uniqid#Examples
---


Expected result:
----------------
...

Actual result:
--------------
...

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-12-25 00:24 UTC] svn@php.net
Automatic comment from SVN on behalf of kalle
Revision: http://svn.php.net/viewvc/?view=revision&revision=292616
Log: Fixed bug #50471 (uniqid example is bad)
 [2009-12-25 00:24 UTC] kalle@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.

I rewrote the examples for uniqid() without the use of a hashing, simply showing the different types of output uniqid() produces.
 [2020-02-07 06:09 UTC] phpdocbot@php.net
Automatic comment on behalf of kalle
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=ca9eb5417eb1fac72be4f85a9fa0455aaaf1af7e
Log: Fixed bug #50471 (uniqid example is bad)
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Thu Oct 08 08:00:01 2026 UTC