protected function getHashAlgorithm()
    {
        // Possible hashes
        $hashes = [
            'sha512',
            'sha256',
            'sha384',
            'ripemd160',
            'sha224',
            'mdc2'
        ];

        $hashEnabled = hash_algos();

        foreach ($hashes as $hash) {
            if (in_array($hash, $hashEnabled)) {
                return strtoupper($hash);
            }
        }

        throw new \RuntimeException(
            Translator::getInstance()->trans(
                "Failed to find a suitable hash algorithm. Please check your PHP configuration."
            )
        );
    }