aboutsummaryrefslogtreecommitdiff
path: root/app/Controllers/javascriptController.php
diff options
context:
space:
mode:
authorGravatar ColonelMoutarde <4697568+ColonelMoutarde@users.noreply.github.com> 2018-08-23 19:57:45 +0200
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2018-08-23 19:57:45 +0200
commitd38911e5b97725a28d12b07f3842a452e6acba36 (patch)
treed021ff1ab21d69cae05bdfc48bf29d66ef02a905 /app/Controllers/javascriptController.php
parent34d8be086c19cef6cbe236d4d541f460449852da (diff)
Better rand() (#1976)
http://php.net/manual/en/function.mt-rand.php from php Doc "Many random number generators of older libcs have dubious or unknown characteristics and are slow. The mt_rand() function is a drop-in replacement for the older rand(). It uses a random number generator with known characteristics using the ยป Mersenne Twister, which will produce random numbers four times faster than what the average libc rand() provides. "
Diffstat (limited to 'app/Controllers/javascriptController.php')
-rwxr-xr-xapp/Controllers/javascriptController.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/Controllers/javascriptController.php b/app/Controllers/javascriptController.php
index 6336106a9..9d7acf647 100755
--- a/app/Controllers/javascriptController.php
+++ b/app/Controllers/javascriptController.php
@@ -47,8 +47,8 @@ class FreshRSS_javascript_Controller extends Minz_ActionController {
$this->view->salt1 = sprintf('$2a$%02d$', FreshRSS_user_Controller::BCRYPT_COST);
$alphabet = './ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
for ($i = 22; $i > 0; $i--) {
- $this->view->salt1 .= $alphabet[rand(0, 63)];
+ $this->view->salt1 .= $alphabet[mt_rand(0, 63)];
}
- $this->view->nonce = sha1(rand());
+ $this->view->nonce = sha1(mt_rand());
}
}