From 619000a06fa53113480ea6448d65c5806edaeab1 Mon Sep 17 00:00:00 2001 From: sy-records <52o@qq52o.cn> Date: Fri, 27 Oct 2023 09:57:02 +0800 Subject: [PATCH] Fix error --- src/AlphaID.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/AlphaID.php b/src/AlphaID.php index 12c8bc5..d8889d0 100644 --- a/src/AlphaID.php +++ b/src/AlphaID.php @@ -5,6 +5,7 @@ use Luffy\Exception\DecodeException; use Luffy\Exception\InvalidArgumentException; +#[\AllowDynamicProperties] class AlphaID { const MIN_ALPHABET_LENGTH = 16; @@ -216,7 +217,7 @@ private function _encode(array $numbers) $excess = strlen($ret) - $this->_min_hash_length; if ($excess > 0) { - $ret = substr($ret, $excess / 2, $this->_min_hash_length); + $ret = substr($ret, (int)($excess / 2), $this->_min_hash_length); } }