// Include some information about the filesystem's current state in the random state
$files = array();
- // We know this file is here so grab some info about ourself
+ // We know this file is here so grab some info about ourselves
$files[] = __FILE__;
// We must also have a parent folder, and with the usual file structure, a grandparent
}
}
// The absolute filename itself will differ from install to install so don't leave it out
- if( ( $path = realpath( $file ) ) !== false ) {
+ if ( ( $path = realpath( $file ) ) !== false ) {
$state .= $path;
} else {
$state .= $file;
/**
* Randomly hash data while mixing in clock drift data for randomness
*
- * @param $data string The data to randomly hash.
+ * @param string $data The data to randomly hash.
* @return String The hashed bytes
* @author Tim Starling
*/
$buffer = str_repeat( ' ', $bufLength );
$bufPos = 0;
- // Iterate for $duration seconds or at least $minIerations number of iterations
+ // Iterate for $duration seconds or at least $minIterations number of iterations
$iterations = 0;
$startTime = microtime( true );
$currentTime = $startTime;
* You can use MWCryptRand::wasStrong() if you wish to know if the source used
* was cryptographically strong.
*
- * @param $bytes int the number of bytes of random data to generate
- * @param $forceStrong bool Pass true if you want generate to prefer cryptographically
+ * @param int $bytes the number of bytes of random data to generate
+ * @param bool $forceStrong Pass true if you want generate to prefer cryptographically
* strong sources of entropy even if reading from them may steal
* more entropy from the system than optimal.
* @return String Raw binary random data
* You can use MWCryptRand::wasStrong() if you wish to know if the source used
* was cryptographically strong.
*
- * @param $chars int the number of hex chars of random data to generate
- * @param $forceStrong bool Pass true if you want generate to prefer cryptographically
+ * @param int $chars the number of hex chars of random data to generate
+ * @param bool $forceStrong Pass true if you want generate to prefer cryptographically
* strong sources of entropy even if reading from them may steal
* more entropy from the system than optimal.
* @return String Hexadecimal random data