Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Decodes data encoded with MIME base64
<?php base64_decode(string $string, bool $strict = false): string|false
<?php     {

        $content = explode(' ', $publicKey, 3);



        return implode(':', str_split(md5(base64_decode($content[1])), 2));

    }



    private function authenticate(SFTP $connection): void
<?php     {

        $content = explode(' ', $publicKey, 3);



        return implode(':', str_split(md5(base64_decode($content[1])), 2));

    }

}
<?php         $content = explode(' ', $publicKey, 3);

        $algo = $content[0] === 'ssh-rsa' ? 'md5' : 'sha512';



        return implode(':', str_split(hash($algo, base64_decode($content[1])), 2));

    }



    private function authenticate(SFTP $connection): void
<?php         $content = explode(' ', $publicKey, 3);

        $algo = $content[0] === 'ssh-rsa' ? 'md5' : 'sha512';



        return implode(':', str_split(hash($algo, base64_decode($content[1])), 2));

    }

}