private function getHashAlgorithm(string $algorithm) : string
    {
        switch ($algorithm) {
            case Algorithms::SHA256:
                return 'sha256';
            case Algorithms::SHA384:
                return 'sha384';
            case Algorithms::SHA512:
                return 'sha512';
            default:
                throw new InvalidArgumentException("Algorithm \"$algorithm\" is not a hash algorithm");
        }
    }
private function getHashAlgorithm(string $algorithm) : string
    {
        switch ($algorithm) {
            case Algorithms::SHA256:
                return 'sha256';
            case Algorithms::SHA384:
                return 'sha384';
            case Algorithms::SHA512:
                return 'sha512';
            default:
                throw new InvalidArgumentException("Algorithm \"$algorithm\" is not a hash algorithm");
        }
    }
private function getHashAlgorithm ( string $ algorithm ) : string { switch ( $ algorithm ) { case Algorithms :: SHA256 : return 'sha256' ; case Algorithms :: SHA384 : return 'sha384' ; case Algorithms :: SHA512 : return 'sha512' ; default : throw new InvalidArgumentException ( "Algorithm \"$algorithm\" is not a hash algorithm" ) ; } }
Gets the hash algorithm for an algorithm

@param string $algorithm The algorithm whose hash algorithm we want
@return string The algorithm to use in a hash function
@throws InvalidArgumentException Thrown if the algorithm is not an OpenSSL algorithm
Gets the hash algorithm for an algorithm