@@ -41,13 +41,13 @@ class Crypt
41
41
/**
42
42
* Constructor
43
43
*
44
- * @param string $key Secret encryption key.
45
- * It's unsafe to store encryption key in memory, so no getter for key exists.
46
- * @param string $cipher Cipher algorithm (one of the MCRYPT_ciphername constants)
47
- * @param string $mode Mode of cipher algorithm (MCRYPT_MODE_modeabbr constants)
48
- * @param string|bool $initVector Initial vector to fill algorithm blocks.
49
- * TRUE generates a random initial vector.
50
- * FALSE fills initial vector with zero bytes to not use it.
44
+ * @param string $key Secret encryption key.
45
+ * It's unsafe to store encryption key in memory, so no getter for key exists.
46
+ * @param string $cipher Cipher algorithm (one of the MCRYPT_ciphername constants)
47
+ * @param string $mode Mode of cipher algorithm (MCRYPT_MODE_modeabbr constants)
48
+ * @param string|bool $initVector Initial vector to fill algorithm blocks.
49
+ * TRUE generates a random initial vector.
50
+ * FALSE fills initial vector with zero bytes to not use it.
51
51
* @throws \Exception
52
52
*/
53
53
public function __construct (
@@ -66,7 +66,7 @@ public function __construct(
66
66
$ allowedCharacters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ' ;
67
67
$ initVector = '' ;
68
68
for ($ i = 0 ; $ i < $ initVectorSize ; $ i ++) {
69
- $ initVector .= $ allowedCharacters [rand (0 , strlen ($ allowedCharacters ) - 1 )];
69
+ $ initVector .= $ allowedCharacters [random_int (0 , strlen ($ allowedCharacters ) - 1 )];
70
70
}
71
71
// @codingStandardsIgnoreStart
72
72
@mcrypt_generic_deinit ($ handle );
0 commit comments