Fix block scope for local declarations
Build / AerScript (push) Successful in 40s

This commit is contained in:
2026-10-25 19:22:50 +01:00
parent 3e3b795626
commit 8a2d7d8bd3
4 changed files with 277 additions and 52 deletions
+4 -2
View File
@@ -18,7 +18,8 @@ class Base32 {
if(!$input) return '';
char[] $aInput = str_split($input);
string $binaryString = '';
for(int $i = 0; $i < sizeof($aInput); $i++) {
int $i;
for($i = 0; $i < sizeof($aInput); $i++) {
$binaryString += str_pad(base_convert(ord($aInput[$i]), 10, 2), 8, '0', STR_PAD_LEFT);
}
string[] $fiveBitBinaryArray = str_split($binaryString, 5);
@@ -43,7 +44,8 @@ class Base32 {
int $paddingCharCount = substr_count($input, Base32::$map[32]);
int[] $allowedValues = {6, 4, 3, 1, 0};
if(!in_array($paddingCharCount, $allowedValues)) return '';
for(int $i = 0; $i < 4; $i++) {
int $i;
for($i = 0; $i < 4; $i++) {
if($paddingCharCount == $allowedValues[$i] && substr($input, -($allowedValues[$i])) != str_repeat(Base32::$map[32], $allowedValues[$i]))
return '';
}