/** * Returns a random string with alpha-numeric characters. * * @param integer $count Number of characters to generate * @param string $characters Allowed characters, defaults to alpha-numeric (a-zA-Z0-9) * @return string A random string */ public static function generateRandomString($count, $characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789') { return \Security_Randomizer::getRandomString($count, $characters); }
/** * A private method for calculating frequencies. * * @return void */ private static function entropyFrequencies() { $tokenFreqs = array(); for ($i = 0; $i < self::$entropyNumEvents; $i++) { $tmp = ord(self::entropyDataPosition($i)); if (isset($tokenFreqs[$tmp])) { $tokenFreqs[$tmp]++; } else { $tokenFreqs[$tmp] = 1; } } self::$entropyTokenFreqs = $tokenFreqs; }