note 98662 added to function.uniqid
| From: | php at ryanmckeel dot com | Date: | Tue, 29 Jun 2010 17:15:17 +0000 |
| Subject: | note 98662 added to function.uniqid | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-170557@lists.php.net to get a copy of this message | ||
Calls to uuid_make that use the constants UUID_MAKE_V5 or UUID_MAKE_V3 (using Debian package
php5-uuid available June 2010) will not work with only two variables.
I could not find good documentation, so I read some source code and figured out that this would
work:
uuid_create(&$v5);
//uuid_make($v5, UUID_MAKE_V5);
uuid_make($v5, UUID_MAKE_V5,$v5,$uniqid());
uuid_export($v5, UUID_FMT_STR, &$v5String);
Please use at your own risk. This may not be the best way to give this param variables, but it at
least makes it work what appears to be properly (generating unique ID's).
I imagine that UUID_MAKE_V3 is similar in what it needs.
Ryan
----
Server IP: 69.147.83.197
Probable Submitter: 192.174.37.50
----
Manual Page -- http://www.php.net/manual/en/function.uniqid.php
Edit -- https://master.php.net/note/edit/98662
Del: integrated -- https://master.php.net/note/delete/98662/integrated
Del: useless -- https://master.php.net/note/delete/98662/useless
Del: bad code -- https://master.php.net/note/delete/98662/bad+code
Del: spam -- https://master.php.net/note/delete/98662/spam
Del: non-english -- https://master.php.net/note/delete/98662/non-english
Del: in docs -- https://master.php.net/note/delete/98662/in+docs
Del: other reasons-- https://master.php.net/note/delete/98662
Reject -- https://master.php.net/note/reject/98662
Search -- https://master.php.net/manage/user-notes.php