From fe315db271908755d88f3058f07c628d215fac75 Mon Sep 17 00:00:00 2001 From: Abraham Williams <4braham@gmail.com> Date: Thu, 18 Aug 2022 19:28:09 -0400 Subject: [PATCH] Set min/max on random_int --- src/Request.php | 2 +- tests/mocks.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Request.php b/src/Request.php index 74713691..396fbd46 100644 --- a/src/Request.php +++ b/src/Request.php @@ -282,6 +282,6 @@ public function buildSignature( */ public static function generateNonce(): string { - return md5(microtime() . random_int()); + return md5(microtime() . random_int(PHP_INT_MIN, PHP_INT_MAX)); } } diff --git a/tests/mocks.php b/tests/mocks.php index dcaee6c5..26d79352 100644 --- a/tests/mocks.php +++ b/tests/mocks.php @@ -15,7 +15,7 @@ function microtime() return 'FAKE_MICROTIME'; } -function random_int() +function random_int($_min, $_max) { return 123_456_789; }