Added parameter 'key' to encryption methods to allow own keys
[core.git] / inc / classes / main / rng / class_RandomNumberGenerator.php
index 6ab821a164e14709fee5181a684bea9372e2c8d5..00eb513fe4f2e9158128fbcaddefc79fad9ba7ff 100644 (file)
@@ -126,7 +126,9 @@ class RandomNumberGenerator extends BaseFrameworkSystem {
         */
        public function randomString ($length = -1) {
                // Is the number <1, then fix it to default length
-               if ($length < 1) $length = $this->rndStrLen;
+               if ($length < 1) {
+                       $length = $this->rndStrLen;
+               } // END - if
 
                // Initialize the string
                $randomString = '';
@@ -135,7 +137,7 @@ class RandomNumberGenerator extends BaseFrameworkSystem {
                for ($idx = 0; $idx < $length; $idx++) {
                        // Add a random character and add it to our string
                        $randomString .= chr($this->randomNumber(0, 255));
-               }
+               } // END - for
 
                // Return the random string a little mixed up
                return str_shuffle($randomString);