]> git.mxchange.org Git - shipsimu.git/blobdiff - inc/classes/main/rng/class_RandomNumberGenerator.php
Salt length reduced
[shipsimu.git] / inc / classes / main / rng / class_RandomNumberGenerator.php
index 5856b9e214a23cbea465a04151c94e2ffa615aaa..a8063c6fc234e22b00a037a2daf1e8aae9a8e9ff 100644 (file)
@@ -38,9 +38,9 @@ class RandomNumberGenerator extends BaseFrameworkSystem {
        private $extraSalt = "";
 
        /**
-        * Maximum length for salt
+        * Maximum length for random string
         */
-       private $saltLength = 0;
+       private $rndStrLen = 0;
 
        /**
         * Private constructor
@@ -97,7 +97,7 @@ class RandomNumberGenerator extends BaseFrameworkSystem {
                $this->extraSalt = sha1(getenv('SERVER_ADDR') . ":" . getenv('SERVER_SOFTWARE') . ":" . $this->getConfigInstance()->readConfig('date_key') . ":" . serialize($this->getDatabaseInstance()->getConnectionData()));
 
                // Get config entry for max salt length
-               $this->saltLength = $this->getConfigInstance()->readConfig('salt_length');
+               $this->rndStrLen = $this->getConfigInstance()->readConfig('rnd_str_length');
        }
 
        /**
@@ -108,7 +108,7 @@ class RandomNumberGenerator extends BaseFrameworkSystem {
         */
        public function makeRandomString ($length = -1) {
                // Is the number <1, then fix it to default length
-               if ($length < 1) $length = $this->saltLength;
+               if ($length < 1) $length = $this->rndStrLen;
 
                // Initialize the string
                $randomString = "";