svn: /phpdoc/en/trunk/reference/csprng/functions/ random-bytes.xml random-int.xml
| From: | Adam Harvey | Date: | Mon, 21 Sep 2015 12:17:21 +0000 |
| Subject: | svn: /phpdoc/en/trunk/reference/csprng/functions/ random-bytes.xml random-int.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-13752@lists.php.net to get a copy of this message | ||
aharvey Mon, 21 Sep 2015 12:17:21 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=337873
Log:
Improve CSPRNG reference verbiage.
Changed paths:
U phpdoc/en/trunk/reference/csprng/functions/random-bytes.xml
U phpdoc/en/trunk/reference/csprng/functions/random-int.xml
Modified: phpdoc/en/trunk/reference/csprng/functions/random-bytes.xml
===================================================================
--- phpdoc/en/trunk/reference/csprng/functions/random-bytes.xml 2015-09-21 12:17:17 UTC (rev 337872)
+++ phpdoc/en/trunk/reference/csprng/functions/random-bytes.xml 2015-09-21 12:17:21 UTC (rev 337873)
@@ -38,21 +38,23 @@
<refsect1 role="returnvalues"><!-- {{{ -->
&reftitle.returnvalues;
<para>
- Returns a string containing the crypto-secure random bytes in binary format.
+ Returns a string containing the requested number of cryptographically
+ secure random bytes.
</para>
</refsect1><!-- }}} -->
<refsect1 role="errors"><!-- {{{ -->
&reftitle.errors;
<para>
- Issues an <constant>E_WARNING</constant> and returns &false; when a sufficient
source of randomness is unavailable.
+ If an appropriate source of randomness cannot be found or an invalid number
+ of bytes is given, an <classname>Error</classname> will be thrown.
</para>
</refsect1><!-- }}} -->
<refsect1 role="examples"><!-- {{{ -->
&reftitle.examples;
<example xml:id="random-bytes.example.basic"><!-- {{{ -->
- <title><function>random-bytes</function> example</title>
+ <title><function>random_bytes</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
Modified: phpdoc/en/trunk/reference/csprng/functions/random-int.xml
===================================================================
--- phpdoc/en/trunk/reference/csprng/functions/random-int.xml 2015-09-21 12:17:17 UTC (rev 337872)
+++ phpdoc/en/trunk/reference/csprng/functions/random-int.xml 2015-09-21 12:17:21 UTC (rev 337873)
@@ -29,7 +29,8 @@
<term><parameter>min</parameter></term>
<listitem>
<para>
- The lowest value to be returned down to <constant>PHP_INT_MIN</constant>.
+ The lowest value to be returned, which must be
+ <constant>PHP_INT_MIN</constant> or higher.
</para>
</listitem>
</varlistentry>
@@ -37,7 +38,8 @@
<term><parameter>max</parameter></term>
<listitem>
<para>
- The highest value to be returned up to <constant>PHP_INT_MAX</constant>.
+ The highest value to be returned, which must be less than or equal to
+ <constant>PHP_INT_MAX</constant>.
</para>
</listitem>
</varlistentry>
@@ -47,14 +49,17 @@
<refsect1 role="returnvalues"><!-- {{{ -->
&reftitle.returnvalues;
<para>
- Returns a crypto-secure random integer.
+ Returns a cryptographically secure random integer in the range
+ <parameter>min</parameter> to <parameter>max</parameter>, inclusive.
</para>
</refsect1><!-- }}} -->
<refsect1 role="errors"><!-- {{{ -->
&reftitle.errors;
<para>
- Issues an <constant>E_WARNING</constant> and returns &false; when a sufficient
source of randomness is unavailable.
+ If an appropriate source of randomness cannot be found, invalid parameters
+ are given, or <parameter>max</parameter> is less than
+ <parameter>min</parameter>, an <classname>Error</classname> will be
thrown.
</para>
</refsect1><!-- }}} -->