Passed
Push — master ( e54e61...2c6184 )
by Roeland
09:34
created
lib/public/Security/ISecureRandom.php 1 patch
Indentation   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -39,30 +39,30 @@
 block discarded – undo
39 39
  */
40 40
 interface ISecureRandom {
41 41
 
42
-	/**
43
-	 * Flags for characters that can be used for <code>generate($length, $characters)</code>
44
-	 */
45
-	const CHAR_UPPER = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
46
-	const CHAR_LOWER = 'abcdefghijklmnopqrstuvwxyz';
47
-	const CHAR_DIGITS = '0123456789';
48
-	const CHAR_SYMBOLS = '!\"#$%&\\\'()* +,-./:;<=>?@[\]^_`{|}~';
42
+    /**
43
+     * Flags for characters that can be used for <code>generate($length, $characters)</code>
44
+     */
45
+    const CHAR_UPPER = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
46
+    const CHAR_LOWER = 'abcdefghijklmnopqrstuvwxyz';
47
+    const CHAR_DIGITS = '0123456789';
48
+    const CHAR_SYMBOLS = '!\"#$%&\\\'()* +,-./:;<=>?@[\]^_`{|}~';
49 49
 
50
-	/**
51
-	 * Characters that can be used for <code>generate($length, $characters)</code>, to
52
-	 * generate human readable random strings. Lower- and upper-case characters and digits 
53
-	 * are included. Characters which are ambiguous are excluded, such as I, l, and 1 and so on.
54
-	 */
55
-	const CHAR_HUMAN_READABLE = 'abcdefgijkmnopqrstwxyzABCDEFGHJKLMNPQRSTWXYZ23456789';
50
+    /**
51
+     * Characters that can be used for <code>generate($length, $characters)</code>, to
52
+     * generate human readable random strings. Lower- and upper-case characters and digits 
53
+     * are included. Characters which are ambiguous are excluded, such as I, l, and 1 and so on.
54
+     */
55
+    const CHAR_HUMAN_READABLE = 'abcdefgijkmnopqrstwxyzABCDEFGHJKLMNPQRSTWXYZ23456789';
56 56
 
57
-	/**
58
-	 * Generate a random string of specified length.
59
-	 * @param int $length The length of the generated string
60
-	 * @param string $characters An optional list of characters to use if no character list is
61
-	 * 							specified all valid base64 characters are used.
62
-	 * @return string
63
-	 * @since 8.0.0
64
-	 */
65
-	public function generate(int $length,
66
-							 string $characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'): string;
57
+    /**
58
+     * Generate a random string of specified length.
59
+     * @param int $length The length of the generated string
60
+     * @param string $characters An optional list of characters to use if no character list is
61
+     * 							specified all valid base64 characters are used.
62
+     * @return string
63
+     * @since 8.0.0
64
+     */
65
+    public function generate(int $length,
66
+                                string $characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'): string;
67 67
 
68 68
 }
Please login to merge, or discard this patch.
lib/private/Security/SecureRandom.php 1 patch
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -36,23 +36,23 @@
 block discarded – undo
36 36
  * @package OC\Security
37 37
  */
38 38
 class SecureRandom implements ISecureRandom {
39
-	/**
40
-	 * Generate a random string of specified length.
41
-	 * @param int $length The length of the generated string
42
-	 * @param string $characters An optional list of characters to use if no character list is
43
-	 * 							specified all valid base64 characters are used.
44
-	 * @return string
45
-	 */
46
-	public function generate(int $length,
47
-							 string $characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'): string {
48
-		$maxCharIndex = \strlen($characters) - 1;
49
-		$randomString = '';
39
+    /**
40
+     * Generate a random string of specified length.
41
+     * @param int $length The length of the generated string
42
+     * @param string $characters An optional list of characters to use if no character list is
43
+     * 							specified all valid base64 characters are used.
44
+     * @return string
45
+     */
46
+    public function generate(int $length,
47
+                                string $characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'): string {
48
+        $maxCharIndex = \strlen($characters) - 1;
49
+        $randomString = '';
50 50
 
51
-		while($length > 0) {
52
-			$randomNumber = \random_int(0, $maxCharIndex);
53
-			$randomString .= $characters[$randomNumber];
54
-			$length--;
55
-		}
56
-		return $randomString;
57
-	}
51
+        while($length > 0) {
52
+            $randomNumber = \random_int(0, $maxCharIndex);
53
+            $randomString .= $characters[$randomNumber];
54
+            $length--;
55
+        }
56
+        return $randomString;
57
+    }
58 58
 }
Please login to merge, or discard this patch.