From f600a9bb504ac753cdb9febae376e6cafec33358 Mon Sep 17 00:00:00 2001 From: Jim Wigginton Date: Thu, 24 Nov 2011 19:03:56 +0000 Subject: [PATCH] - !== is faster than != git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@189 21d32557-59b3-4da0-833f-c5933fad653e --- phpseclib/Crypt/Random.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpseclib/Crypt/Random.php b/phpseclib/Crypt/Random.php index a880c35b..eb3db992 100644 --- a/phpseclib/Crypt/Random.php +++ b/phpseclib/Crypt/Random.php @@ -66,7 +66,7 @@ function crypt_random($min = 0, $max = 0x7FFFFFFF) if (function_exists('openssl_random_pseudo_bytes')) { // openssl_random_pseudo_bytes() is slow on windows per the following: // http://stackoverflow.com/questions/1940168/openssl-random-pseudo-bytes-is-slow-php - if ((PHP_OS & "\xDF\xDF\xDF") != 'WIN') { // PHP_OS & "\xDF\xDF\xDF" == strtoupper(substr(PHP_OS, 0, 3)), but a lot faster + if ((PHP_OS & "\xDF\xDF\xDF") !== 'WIN') { // PHP_OS & "\xDF\xDF\xDF" == strtoupper(substr(PHP_OS, 0, 3)), but a lot faster extract(unpack('Nrandom', openssl_random_pseudo_bytes(4))); return abs($random) % ($max - $min) + $min;