Procedural File: Random.php
Source Location: /lib/3rdParty/phpseclib/Crypt/Random.php
Page Details:
Random Number Generator
PHP versions 4 and 5 Here's a short example of how to use this library: <?php
include('Crypt/Random.php');
?>
LICENSE: This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Tags:
crypt_random [line 57]
Integer crypt_random(
[optional $min = 0], [optional $max = 0x7FFFFFFF])
|
|
Generate a random value. On 32-bit machines, the largest distance that can exist between $min and $max is 2**31. If $min and $max are farther apart than that then the last ($max - range) numbers. Depending on how this is being used, it may be worth while to write a replacement. For example, a PHP-based web app that stores its data in an SQL database can collect more entropy than this function can.
Tags:
Parameters
optional |
$min |
Integer $min |
optional |
$max |
Integer $max |
|