Méthode | Description | |
---|---|---|
compareStrings ( string $a, string $b ) : boolean | Compare strings | |
hash ( string $str, string $salt = '', boolean $plain = false ) : string | Generate keccak hash for string with salt | |
randomBytes ( integer $len, callable $cb, integer $pri, boolean $hang = false ) : integer | Returns string of pseudo random bytes | |
randomInts ( integer $numInts, callable $cb, integer $pri, boolean $hang = false ) : integer | Returns array of pseudo random integers of machine-dependent size | |
randomInts32 ( integer $numInts, callable $cb, integer $pri, boolean $hang = false ) : integer | Returns array of pseudo random 32-bit integers | |
randomString ( integer $len = null, string $chars = null, callable $cb = null, integer $pri, boolean $hang = false ) : string | Returns string of pseudo random characters | |
stringIdx ( string $str, integer $idx ) : string | Returns the character at index $idx in $str in constant time |
Méthode | Description | |
---|---|---|
getMinimalBitMask ( integer $toRepresent ) : integer | Returns the smallest bit mask of all 1s such that ($toRepresent & mask) = $toRepresent |
protected static getMinimalBitMask ( integer $toRepresent ) : integer | ||
$toRepresent | integer | must be an integer greater than or equal to 1 |
Résultat | integer |
public static randomBytes ( integer $len, callable $cb, integer $pri, boolean $hang = false ) : integer | ||
$len | integer | Length of desired string |
$cb | callable | Callback |
$pri | integer | Priority of EIO operation |
$hang | boolean | If true, we shall use /dev/random instead of /dev/urandom and it may cause a delay |
Résultat | integer |
public static randomInts ( integer $numInts, callable $cb, integer $pri, boolean $hang = false ) : integer | ||
$numInts | integer | Number of integers |
$cb | callable | Callback |
$pri | integer | Priority of EIO operation |
$hang | boolean | If true, we shall use /dev/random instead of /dev/urandom and it may cause a delay |
Résultat | integer |
public static randomInts32 ( integer $numInts, callable $cb, integer $pri, boolean $hang = false ) : integer | ||
$numInts | integer | Number of integers |
$cb | callable | Callback |
$pri | integer | Priority of EIO operation |
$hang | boolean | If true, we shall use /dev/random instead of /dev/urandom and it may cause a delay |
Résultat | integer |
public static randomString ( integer $len = null, string $chars = null, callable $cb = null, integer $pri, boolean $hang = false ) : string | ||
$len | integer | Length of desired string |
$chars | string | String of allowed characters |
$cb | callable | Callback |
$pri | integer | Priority of EIO operation |
$hang | boolean | If true, we shall use /dev/random instead of /dev/urandom and it may cause a delay |
Résultat | string |