PHP Class Zend_Crypt_Math

Inheritance: extends Zend_Crypt_Math_BigInteger
Exibir arquivo Open project: kimai/kimai Class Usage Examples

Public Methods

Method Description
btwoc ( string $long ) : string Get the big endian two's complement of a given big integer in binary notation
fromBinary ( string $binary ) : string Translate a binary form into a big integer string
rand ( string | integer $minimum, string | integer $maximum ) : string Generate a pseudorandom number within the given range.
randBytes ( integer $length, boolean $strong = false ) : string Return a random strings of $length bytes
randInteger ( integer $min, integer $max, boolean $strong = false ) : integer Return a random integer between $min and $max
toBinary ( string $integer ) : string Translate a big integer string into a binary form

Method Details

btwoc() public method

Get the big endian two's complement of a given big integer in binary notation
public btwoc ( string $long ) : string
$long string
return string

fromBinary() public method

Translate a binary form into a big integer string
public fromBinary ( string $binary ) : string
$binary string
return string

rand() public method

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...
public rand ( string | integer $minimum, string | integer $maximum ) : string
$minimum string | integer
$maximum string | integer
return string

randBytes() public static method

Return a random strings of $length bytes
public static randBytes ( integer $length, boolean $strong = false ) : string
$length integer
$strong boolean
return string

randInteger() public static method

Return a random integer between $min and $max
public static randInteger ( integer $min, integer $max, boolean $strong = false ) : integer
$min integer
$max integer
$strong boolean
return integer

toBinary() public method

Translate a big integer string into a binary form
public toBinary ( string $integer ) : string
$integer string
return string