diff --git a/lib/PasswordLib/Random/Source/UniqID.php b/lib/PasswordLib/Random/Source/UniqID.php index cedbb74..987a090 100644 --- a/lib/PasswordLib/Random/Source/UniqID.php +++ b/lib/PasswordLib/Random/Source/UniqID.php @@ -52,9 +52,26 @@ public static function getStrength() { */ public function generate($size) { $result = ''; - while (strlen($result) < $size) { - $result = uniqid($result, true); + + if(defined('HHVM_VERSION')) { + + while (strlen($result) < $size) { + + $result = $result . uniqid('', true); + } + + } else { + + while (strlen($result) < $size) { + + if(defined('HHVM_VERSION')) { + $result = $result . uniqid('', true); + } else { + $result = uniqid($result, true); + } + } } + return substr($result, 0, $size); }