diff --git a/src/index.php b/src/index.php index 8ba5347..eec75e0 100644 --- a/src/index.php +++ b/src/index.php @@ -106,7 +106,7 @@ public static function getAuthCode($shared_secret, $time_offset = 0) { $code = ''; for ($i = 0; $i < self::CODE_LENGTH; $i++) { - $code .= substr(self::CHARSET, $fullcode % strlen(self::CHARSET), 1); + $code .= substr(self::CHARSET, (int) $fullcode % strlen(self::CHARSET), 1); $fullcode /= strlen(self::CHARSET); }