mirror of
https://github.com/php/pecl-encryption-mcrypt.git
synced 2026-03-23 23:12:15 +01:00
use php_mt_rand_range for 8.4
This commit is contained in:
6
mcrypt.c
6
mcrypt.c
@@ -38,7 +38,11 @@
|
||||
#include "php_ini.h"
|
||||
#include "php_globals.h"
|
||||
#include "ext/standard/info.h"
|
||||
#if PHP_VERSION_ID < 80400
|
||||
#include "ext/standard/php_rand.h"
|
||||
#else
|
||||
#include "ext/random/php_random.h"
|
||||
#endif
|
||||
#include "zend_smart_str.h"
|
||||
#include "php_mcrypt_filter.h"
|
||||
|
||||
@@ -1414,7 +1418,7 @@ PHP_FUNCTION(mcrypt_create_iv)
|
||||
} else {
|
||||
n = (int)size;
|
||||
while (size) {
|
||||
iv[--size] = (char) (255.0 * php_rand() / RAND_MAX);
|
||||
iv[--size] = (char)php_mt_rand_range(0, 255);
|
||||
}
|
||||
}
|
||||
RETVAL_STRINGL(iv, n);
|
||||
|
||||
Reference in New Issue
Block a user