Zend Framework  1.12
Public Member Functions | List of all members
Zend_Crypt_Math Class Reference

Public Member Functions

 rand ($minimum, $maximum)
 Generate a pseudorandom number within the given range.
 
 btwoc ($long)
 Get the big endian two's complement of a given big integer in binary notation.
 
 fromBinary ($binary)
 Translate a binary form into a big integer string.
 
 toBinary ($integer)
 Translate a big integer string into a binary form.
 
- Public Member Functions inherited from Zend_Crypt_Math_BigInteger
 __construct ($extension=null)
 Constructor; a Factory which detects a suitable PHP extension for arbitrary precision math and instantiates the suitable wrapper object.
 
 __call ($methodName, $args)
 Redirect all public method calls to the wrapped extension object.
 

Additional Inherited Members

- Protected Member Functions inherited from Zend_Crypt_Math_BigInteger
 _loadAdapter ($extension=null)
 
- Protected Attributes inherited from Zend_Crypt_Math_BigInteger
 $_math = null
 

Member Function Documentation

btwoc (   $long)

Get the big endian two's complement of a given big integer in binary notation.

Parameters
string$long
Returns
string
fromBinary (   $binary)

Translate a binary form into a big integer string.

Parameters
string$binary
Returns
string
rand (   $minimum,
  $maximum 
)

Generate a pseudorandom number within the given range.

Will attempt to read from a systems RNG if it exists or else utilises a simple random character to maximum length process. Simplicity is a factor better left for development...

Parameters
string | int$minimum
string | int$maximum
Returns
string
toBinary (   $integer)

Translate a big integer string into a binary form.

Parameters
string$integer
Returns
string