Skip to content

Commit 4042d4b

Browse files
committed
Update base32 user land implementation
1 parent 216edc0 commit 4042d4b

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

Base32.php

-4
Original file line numberDiff line numberDiff line change
@@ -194,10 +194,6 @@ private function prepareDecoding(string $encoded, bool $strict): array
194194
$encoded = str_replace($padding, '', $inside).$end;
195195
}
196196

197-
if ('' === $encoded) {
198-
return [$encoded, $alphabet, $padding];
199-
}
200-
201197
$remainder = strlen($encoded) % 8;
202198
if (0 !== $remainder) {
203199
if ($strict) {

Base32Test.php

+2
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ public static function base32decodeAsciiDataProvider(): array
124124
return [
125125
...self::base32encodeAsciiDataProvider(),
126126
'All Invalid Characters' => ['', '8908908908908908'],
127+
'empty Characters' => ['', ' '],
127128
];
128129
}
129130

@@ -158,6 +159,7 @@ public static function base32decodeHexDataProvider(): array
158159
return [
159160
...self::base32encodeHexDataProvider(),
160161
'All Invalid Characters' => ['', 'WXYXWXYZWXYZWXYZ'],
162+
'empty Characters' => ['', ' '],
161163
];
162164
}
163165

0 commit comments

Comments
 (0)