protected static function internalDecode($string, $errmode = self::NORMALIZE_ERRMODE_SILENT, $isChecksum = false)
    {
        if ('' === $string) {
            return '';
        }

        if (null === $string) {
            return '';
        }

        $string = static::normalize($string, $errmode);

        if ($isChecksum) {
            $valid = '/^[A-Z0-9\*\~\$=U]$/';
        } else {
            $valid = '/^[A-TV-Z0-9]+$/';
        }

        if (!preg_match($valid, $string)) {
            throw new \RuntimeException("String '$string' contains invalid characters");
        }

        $total = 0;
        foreach (str_split($string) as $symbol) {
            $total = $total * 32 + static::$flippedSymbols[$symbol];
        }

        return $total;
    }