0, // ord 65 'B' => 1, 'C' => 2, 'D' => 3, 'E' => 4, 'F' => 5, 'G' => 6, 'H' => 7, 'I' => 8, 'J' => 9, 'K' => 10, 'L' => 11, 'M' => 12, 'N' => 13, 'O' => 14, 'P' => 15, 'Q' => 16, 'R' => 17, 'S' => 18, 'T' => 19, 'U' => 20, 'V' => 21, 'W' => 22, 'X' => 23, 'Y' => 24, 'Z' => 25, // ord 90 '2' => 26, // ord 50 '3' => 27, '4' => 28, '5' => 29, '6' => 30, '7' => 31 // ord 55 ); protected static function Base32Decode(string $data) { $data = \strtoupper(\rtrim($data, "=\x20\t\n\r\0\x0B")); $dataSize = \strlen($data); $buf = 0; $bufSize = 0; $res = ''; for ($i = 0; $i < $dataSize; ++$i) { $c = $data[$i]; if (isset(static::$map[$c])) { $buf = ($buf << 5) | static::$map[$c]; $bufSize += 5; if ($bufSize > 7) { $bufSize -= 8; $res .= \chr(($buf & (0xff << $bufSize)) >> $bufSize); } } } return $res; } }