dave Tue Aug 10 23:04:15 2004 EDT
Modified files:
/phpdoc/en/reference/misc/functions uniqid.xml
Log:
- Fix protos.
- Update version-specific information.
- Expand LCG acronym.
- Clean up example.
http://cvs.php.net/diff.php/phpdoc/en/reference/misc/functions/uniqid.xml?r1=1.6&r2=1.7&ty=u
Index: phpdoc/en/reference/misc/functions/uniqid.xml
diff -u phpdoc/en/reference/misc/functions/uniqid.xml:1.6
phpdoc/en/reference/misc/functions/uniqid.xml:1.7
--- phpdoc/en/reference/misc/functions/uniqid.xml:1.6 Thu Jul 22 20:18:22 2004
+++ phpdoc/en/reference/misc/functions/uniqid.xml Tue Aug 10 23:04:14 2004
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.6 $ -->
+<!-- $Revision: 1.7 $ -->
<!-- splitted from ./en/functions/misc.xml, last change in rev 1.2 -->
<refentry id="function.uniqid">
<refnamediv>
@@ -10,31 +10,33 @@
<title>Description</title>
<methodsynopsis>
<type>string</type><methodname>uniqid</methodname>
- <methodparam><type>string</type><parameter>prefix</parameter></methodparam>
- <methodparam
choice="opt"><type>bool</type><parameter>lcg</parameter></methodparam>
+ <methodparam
choice="opt"><type>string</type><parameter>prefix</parameter></methodparam>
+ <methodparam
choice="opt"><type>bool</type><parameter>more_entropy</parameter></methodparam>
</methodsynopsis>
<simpara>
<function>uniqid</function> returns a prefixed unique identifier
- based on the current time in microseconds. The prefix can be
- useful for instance if you generate identifiers simultaneously on
- several hosts that might happen to generate the identifier at the
- same microsecond. <parameter>Prefix</parameter> can be up to 114
+ based on the current time in microseconds. <parameter>prefix</parameter>
+ is optional but can be useful, for instance, if you generate identifiers
+ simultaneously on several hosts that might happen to generate the
+ identifier at the same microsecond. Up until PHP 4.3.1,
+ <parameter>prefix</parameter> could only be a maximum of 114
characters long.
</simpara>
<simpara>
- If the optional <parameter>lcg</parameter> parameter is &true;,
- <function>uniqid</function> will add additional "combined LCG"
- entropy at the end of the return value, which should make the
- results more unique.
+ If the optional <parameter>more_entropy</parameter> parameter is
+ &true;, <function>uniqid</function> will add additional entropy (using
+ the combined linear congruential generator) at the end of the return
+ value, which should make the results more unique.
</simpara>
<simpara>
With an empty <parameter>prefix</parameter>, the returned string
- will be 13 characters long. If <parameter>lcg</parameter> is
+ will be 13 characters long. If <parameter>more_entropy</parameter> is
&true;, it will be 23 characters.
</simpara>
<note>
<simpara>
- The <parameter>lcg</parameter> parameter was introduced in PHP 3.0.13.
+ The <parameter>more_entropy</parameter> parameter was introduced
+ in PHP 3.0.13.
</simpara>
</note>
<para>
@@ -48,7 +50,7 @@
<![CDATA[
<?php
// no prefix
-$token = md5(uniqid(""));
+$token = md5(uniqid());
// better, difficult to guess
$better_token = md5(uniqid(rand(), true));