Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

fbRandom_LCG Class Reference

Inheritance diagram for fbRandom_LCG:

Inheritance graph
[legend]
List of all members.

Detailed Description

RNG using lcg_value() function.

Definition at line 22 of file LCG.php.

Public Member Functions

 nextDouble ()
 nextBase64String ($length=1)
 nextURL64String ($length=1)
 nextBase95String ($length=1)
 nextBoolean ()
 nextGaussian ()
 nextInt ($min=null, $max=null)
 nextSalt ()
 nextPrintableString ($length=1)
 nextString ($length=1)
 nextBytes ($length=1)
 getSeed ()
 setSeed ($seed=null)
 getRandomSeed ()
 setRandomSeed ()

Static Public Member Functions

 _getRandomByte ($modulo=0)
 _getRandomString ($length)
 isAvailable ()
 isBlocking ()
 isSeedable ()
getInstance ($blocking=null, $seed=null)
 getEntropy ()


Member Function Documentation

fbRandom_LCG::_getRandomByte modulo = 0  )  [static]
 

Parameters:
$modulo int 0 thru 255
Returns:
int 0 to 255

Reimplemented from fbRandom.

Definition at line 28 of file LCG.php.

References _getRandomByte().

Referenced by _getRandomByte().

fbRandom_LCG::_getRandomString length  )  [static]
 

Parameters:
$length int length of string
Returns:
string String of random characters of length $length

Reimplemented from fbRandom.

Definition at line 58 of file LCG.php.

fbRandom::getEntropy  )  [static, inherited]
 

Return a string of entropy

Returns:
string

Todo:
would implode('~', ...) be quicker?

Definition at line 114 of file Random.php.

& fbRandom::getInstance blocking = null,
seed = null
[static, inherited]
 

Definition at line 58 of file Random.php.

References fbRandom_DevUrandom::isAvailable(), fbRandom_DevRandom::isAvailable(), isAvailable(), and fbRandom::setSeed().

Referenced by fbHMAC_Login::_getChallenge().

fbRandom::getRandomSeed  )  [inherited]
 

Returns:
int a new random seed

Definition at line 526 of file Random.php.

Referenced by fbRandom_Rand::setSeed(), and fbRandom_MT_Rand::setSeed().

fbRandom::getSeed  )  [inherited]
 

Returns:
int the last seed passed to setSeed(), otherwise null

Definition at line 511 of file Random.php.

References fbRandom::$_seed.

fbRandom::isAvailable  )  [static, inherited]
 

Return if this random class is available or not

Returns:
bool true if this random class is available, otherwise false

Reimplemented in fbRandom_DevRandom, fbRandom_DevUrandom, and fbRandom_GMP.

Definition at line 31 of file Random.php.

fbRandom::isBlocking  )  [static, inherited]
 

Return if this random class blocks or not

Returns:
bool true if this random class blocks, otherwise false

Reimplemented in fbRandom_DevRandom.

Definition at line 41 of file Random.php.

fbRandom::isSeedable  )  [static, inherited]
 

Return if this random class is seedable or not

Returns:
bool true if this random class is seedable, otherwise false

Reimplemented in fbRandom_MT_Rand, and fbRandom_Rand.

Definition at line 51 of file Random.php.

fbRandom::nextBase64String length = 1  )  [inherited]
 

Parameters:
$length int
Returns:
string

Definition at line 188 of file Random.php.

References fbRandom::_getRandomString().

fbRandom::nextBase95String length = 1  )  [inherited]
 

Parameters:
$length int
Returns:
string

Definition at line 234 of file Random.php.

fbRandom::nextBoolean  )  [inherited]
 

Returns:
bool

Definition at line 249 of file Random.php.

References fbRandom::_getRandomByte().

fbRandom::nextBytes length = 1  )  [inherited]
 

Parameters:
$length int
Returns:
string a random string of length $length with ASCII NULs (0x00)

Definition at line 497 of file Random.php.

References fbRandom::_getRandomString().

fbRandom_LCG::nextDouble  ) 
 

Returns:
double >= 0.0 and < 1.0

Reimplemented from fbRandom.

Definition at line 78 of file LCG.php.

fbRandom::nextGaussian  )  [inherited]
 

See also:
http://www.taygeta.com/random/gaussian.html
Returns:
double

Definition at line 310 of file Random.php.

References fbRandom::nextDouble().

fbRandom::nextInt min = null,
max = null
[inherited]
 

Parameters:
$min int
$max int
Returns:
int

Definition at line 338 of file Random.php.

References fbRandom::_getRandomByte(), fbRandom::_getRandomString(), and fbRandom::nextInt().

Referenced by fbRandom::nextInt().

fbRandom::nextPrintableString length = 1  )  [inherited]
 

Todo:
should the characters 128-159 be considered "printable"?
32-126, 160-255, 95 + 96 characters = 191 + 33 = 224 + 32 = 256

Parameters:
$length int
Returns:
string

Definition at line 457 of file Random.php.

References fbRandom::_getRandomByte().

fbRandom::nextSalt  )  [inherited]
 

Returns:
string

Definition at line 440 of file Random.php.

References fbRandom::_getRandomByte().

fbRandom::nextString length = 1  )  [inherited]
 

Parameters:
$length int
Returns:
string a random string of length $length without ASCII NULs (0x00)

Definition at line 481 of file Random.php.

fbRandom::nextURL64String length = 1  )  [inherited]
 

URL compatible Base64 encoding

This is how PHP encodes the session hash when session.hash_bits_per_character is set to '6' in php.ini

Parameters:
$length int
Returns:
string

Definition at line 214 of file Random.php.

References fbRandom::_getRandomString().

fbRandom::setRandomSeed  )  [inherited]
 

Returns:
bool true if this RNG is seedable, otherwise false

Definition at line 533 of file Random.php.

References fbRandom::setSeed().

fbRandom::setSeed seed = null  )  [inherited]
 

Parameters:
$seed mixed an integer of the new seed, or null to generate a new random seed
Returns:
bool true if this RNG is seedable, otherwise false

Reimplemented in fbRandom_MT_Rand, and fbRandom_Rand.

Definition at line 519 of file Random.php.

Referenced by fbRandom::getInstance(), and fbRandom::setRandomSeed().


The documentation for this class was generated from the following file:
Generated on Fri Mar 19 12:52:34 2004 for Freebeer by doxygen 1.3.6-20040222