Exemplo n.º 1
0
 /**
  * Generates a random number using internal methods only.
  *
  * @return string
  */
 public static function generateInternalRandomValue()
 {
     if (!self::$_randomState) {
         self::$_randomState = md5(memory_get_usage() . getmypid() . serialize($_ENV) . serialize($_SERVER) . mt_rand() . microtime(), true);
     }
     $data = md5(uniqid(mt_rand(), true) . memory_get_usage() . microtime() . self::$_randomState, true);
     self::$_randomState = substr($data, 0, 8);
     return $data;
 }