Determines if current source data is base64 encoded

@return boolean
518451
public function isBase64()
    {
        if (!is_string($this->data)) {
            return false;
        }

        return base64_encode(base64_decode($this->data)) === $this->data;
    }
762805
public function isString()
    {
        return $this->data_type === PDO::PARAM_STR ||
            $this->data_type === (PDO::PARAM_STR | PDO::PARAM_INPUT_OUTPUT);
    }
1002589
def b64encode(source):
    
    if compat.PY3:
        source = source.encode('utf-8')
    return base64.b64encode(source).decode('utf-8')
77413
public function getBase64Tag() {
                if($this->owner->exists()) {
                        $url = $this->owner->getBase64Source();
                        $title = ($this->owner->Title) ? $this->owner->Title : $this->owner->Filename;
                        if($this->owner->Title) {
                                $title = Convert::raw2att($this->owner->Title);
                        } else {
                                if(preg_match("/([^\/]*)\.[a-zA-Z0-9]{1,6}$/", $title, $matches)) $title = Convert::raw2att($matches[1]);
                        }
                        return "<img src=\"$url\" alt=\"$title\" />";
                }
        }
202365
private function _encoded_filename()
    {
        $ext = strtolower(pathinfo($this->source_file, PATHINFO_EXTENSION));
        $encode = md5($this->source_file . http_build_query($this->url_params));
        
        // Build the parts of the filename
        $encoded_name = $encode . '-' . $this->source_modified . '.' . $ext;
        
        return $encoded_name;
    }
339903
public function isBinary()
    {
        if (is_string($this->data)) {
            $mime = finfo_buffer(finfo_open(FILEINFO_MIME_TYPE), $this->data);
            return (substr($mime, 0, 4) != 'text' && $mime != 'application/x-empty');
        }

        return false;
    }
442934
public static function isBase64Encoded($input)
    {
        if ($input && @base64_encode(@base64_decode($input, true)) === $input) {
            return true;
        }

        return false;
    }
1038819
public function getEncoded()
    {
        $data = serialize($this->data);
        if (function_exists('gzdeflate'))
        {
            $data = gzdeflate($data);
        }
        $data = base64_encode($data);
        $data .= $this->signature($data);
        return $data;
    }
1077365
function encodeToBase64(originalString) {
    const bytes = te.encode(originalString);
    const byteString = Array.from(bytes, byte => String.fromCharCode(byte)).join("");
    const encoded = btoa(byteString);
    return encoded;
  }
69384
protected function encodeContents()
    {
        $serverIDEncoded = StringType::write($this->serverID);

        $encodedPublicKey = base64_decode($this->getPublicKey());
        $publicKeyLength = VarInt::writeUnsignedVarInt(strlen($encodedPublicKey));

        $encodedToken = $this->getToken();
        $tokenLength = VarInt::writeUnsignedVarInt(strlen($encodedToken));

        return $serverIDEncoded->getEncoded() . $publicKeyLength->getEncoded() . $encodedPublicKey . $tokenLength->getEncoded() . $encodedToken;
    }
129857
private function checkEncodedData(array $encodedData): bool
    {
        $isValid = true;
        foreach ($encodedData as $locale => $namespaceResources) {
            $isValid = $isValid === true &&
                empty($locale) === false &&
                is_array($namespaceResources) === true && $this->checkNamespaceResources($namespaceResources);
        }

        return $isValid;
    }
336736
public function getDataUri()
    {
        if (empty($this->image)) {
            $this->create();
        }

        ob_start();
        call_user_func('image'.$this->image_type, $this->image);
        $contents = ob_get_clean();

        return 'data:image/'.$this->image_type.';base64,'.base64_encode($contents);
    }
642487
protected function sessionEncode()
    {
        $type = ini_get('session.serialize_handler');
        if ($type === 'php') {
            return $this->serializePHP($this->getSessionState());
        }
        if ($type === 'php_binary') {
            return igbinary_serialize($this->getSessionState());
        }
        return false;
    }
1331918
public function getThumbnailEncoded()
    {
        if ($data = base64_decode($this->getThumbnail(), $strict = true)) {
            // In case we don't have the file info extension enabled,
            // we'll set the jpeg mime type as default.
            $mime = 'image/jpeg';

            $image = base64_encode($data);

            if (function_exists('finfo_open')) {
                $finfo = finfo_open();

                $mime = finfo_buffer($finfo, $data, FILEINFO_MIME_TYPE);

                return "data:$mime;base64,$image";
            }

            return "data:$mime;base64,$image";
        }
    }
172484
private function _isCompressed()
    {
        if (is_dir($this->bag)) {
            return false;
        } else {
            $bag = strtolower($this->bag);
            if (endsWith($bag, '.zip')) {
                $this->bagCompression = 'zip';
                return true;
            } else if (endsWith($bag, '.tar.gz') || endsWith($bag, '.tgz')) {
                $this->bagCompression = 'tgz';
                return true;
            }
        }
        return false;
    }
915111
public static function isMBString(): bool
    {
        static $isLoaded;

        if (null === $isLoaded) {
            $isLoaded = extension_loaded('mbstring');

            if ($isLoaded) {
                mb_internal_encoding(self::$encoding);
            }
        }

        return $isLoaded;
    }
573830
public function isSupported()
    {
        $mixer   = $this->getMixer();
        $request = $mixer->getRequest();

        if($request->getFormat() == 'html' && $request->isGet() && !$request->isAjax()) {
            return true;
        }

        return false;
    }