Math_Random
[ class tree: Math_Random ] [ index: Math_Random ] [ all elements ]

Class: Math_Random_mtrand

Source Location: /Math/Random/Mtrand.php

Class Overview

Math_Random
   |
   --Math_Random_mtrand

Object-oriented interface to the PHP Mersenne twister PRNG


Author(s):

Copyright:

  • 2005 Ants Aasma

Methods


Inherited Methods

Class: Math_Random

Math_Random::getFloat()
Return a random float
Math_Random::getInteger()
Return a random integer
Math_Random::getMaxInteger()
Return maximum supported integer
Math_Random::getMinInteger()
Return minimum supported integer
Math_Random::getString()
Get a string of random characters

Class Details

[line 59]
Object-oriented interface to the PHP Mersenne twister PRNG

An object oriented interface to PHP's mt_rand() function implementing the Mersenne twister algorithm.

Be aware that this method is not suitable for cryptographic uses. Given a sequence of numbers the full sequence is quite easily predictable. Additionally the seeding value is 31 bits in length, meaning at most 2 billion different sequences.




Tags:

license:  BSD License (3 Clause)
copyright:  2005 Ants Aasma
author:  Ants Aasma <ants.aasma@gmail.com>


[ Top ]


Class Methods


method getInteger [line 116]

int getInteger( int $min, int $max)

Return a random integer

Returns a random integer between $min and $max (inclusive).




Tags:

return:  Random integer


Overrides Math_Random::getInteger() (Return a random integer)

Parameters:

int   $min   minimum value of the random number
int   $max   maximum value of the random number

[ Top ]

method getMaxInteger [line 102]

int getMaxInteger( )

Return maximum supported integer

The value returned by this function is the upper limit to the getInteger method parameters. Values above this are not supported by the used class and will most likely not work.




Tags:

return:  Minimum supported integer


Overrides Math_Random::getMaxInteger() (Return maximum supported integer)

[ Top ]

method getMinInteger [line 88]

int getMinInteger( )

Return minimum supported integer

The value returned by this function is the lower limit to the getInteger method parameters. Values below this are not supported by the used class and will most likely not work.




Tags:

return:  Minimum supported integer


Overrides Math_Random::getMinInteger() (Return minimum supported integer)

[ Top ]

method getString [line 69]

string getString( int $len)

Get a string of random characters

Returns a binary string of 8bit characters with the specified length.




Tags:

return:  string of random characters


Overrides Math_Random::getString() (Get a string of random characters)

Parameters:

int   $len   Length of string to return

[ Top ]


Documentation generated on Sun, 09 Oct 2005 06:53:24 +0300 by phpDocumentor 1.3.0RC3