Skip to content

Commit 7b3755b

Browse files
committed
Merge branch 'codex/add-base32-conversion-methods-with-tests' of github.com:kduma-OSS/PHP-binary-tools into codex/add-base32-conversion-methods-with-tests
2 parents 5700a9f + 94ec357 commit 7b3755b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Base32.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,13 @@ public static function fromBase32(string $base32, string $alphabet = self::DEFAU
7070
}
7171

7272
if (!isset($map[$char])) {
73-
return '';
73+
throw new InvalidArgumentException(
74+
sprintf(
75+
"Invalid character '%s' at position %d in Base32 input.",
76+
$char,
77+
$i
78+
)
79+
);
7480
}
7581

7682
$buffer = ($buffer << 5) | $map[$char];

0 commit comments

Comments
 (0)