diff --git a/src/Utility/Security.php b/src/Utility/Security.php
index <HASH>..<HASH> 100644
--- a/src/Utility/Security.php
+++ b/src/Utility/Security.php
@@ -122,7 +122,7 @@ class Security
             E_USER_WARNING
         );
         $bytes = '';
-        while ($bytes < $length) {
+        while (strlen($bytes) < $length) {
             $bytes .= static::hash(Text::uuid() . uniqid(mt_rand(), true), 'sha512', true);
         }
         return substr($bytes, 0, $length);
Use strlen() as comparing strings to integers is not going to work.