Skip to content

Commit

Permalink
Update base32 user land implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
nyamsprod committed Apr 1, 2024
1 parent dff5646 commit a537d04
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 0 additions & 4 deletions src/Base32/Base32.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,6 @@ private function prepareDecoding(string $encoded, bool $strict): array
$encoded = str_replace($padding, '', $inside).$end;
}

if ('' === $encoded) {
return [$encoded, $alphabet, $padding];
}

$remainder = strlen($encoded) % 8;
if (0 !== $remainder) {
if ($strict) {
Expand Down
2 changes: 2 additions & 0 deletions src/Base32/Base32Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ public static function base32decodeAsciiDataProvider(): array
return [
...self::base32encodeAsciiDataProvider(),
'All Invalid Characters' => ['', '8908908908908908'],
'empty Characters' => ['', ' '],
];
}

Expand Down Expand Up @@ -158,6 +159,7 @@ public static function base32decodeHexDataProvider(): array
return [
...self::base32encodeHexDataProvider(),
'All Invalid Characters' => ['', 'WXYXWXYZWXYZWXYZ'],
'empty Characters' => ['', ' '],
];
}

Expand Down

0 comments on commit a537d04

Please sign in to comment.