diff --git a/Generators/NanoIdGenerator.php b/Generators/NanoIdGenerator.php index f15b06b..b4429ea 100644 --- a/Generators/NanoIdGenerator.php +++ b/Generators/NanoIdGenerator.php @@ -31,7 +31,7 @@ public function __construct(int $size = null, string $alphabet = null) public function generate(): string { $len = strlen($this->alphabet); - $mask = (2 << log($len - 1) / M_LN2) - 1; + $mask = (2 << (int) (log($len - 1) / M_LN2)) - 1; $step = (int) ceil(1.6 * $mask * $this->size / $len); $id = ''; while (true) {