From d6e1d5d0fb2458dfdd7018ec2f74be120353a3b9 Mon Sep 17 00:00:00 2001 From: Paragon Initiative Enterprises Date: Fri, 10 Jun 2022 20:43:46 -0400 Subject: [PATCH] Fix #44 -- Thanks @HacKanCuBa! --- src/Base32.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Base32.php b/src/Base32.php index 2c3ee61..b4857c1 100644 --- a/src/Base32.php +++ b/src/Base32.php @@ -197,7 +197,7 @@ public static function decodeNoPadding(string $encodedString, bool $upper = fals } if (($srcLen & 7) === 0) { for ($j = 0; $j < 7; ++$j) { - if ($encodedString[$srcLen - 1] === '=') { + if ($encodedString[$srcLen - $j] === '=') { throw new InvalidArgumentException( "decodeNoPadding() doesn't tolerate padding" );