public function setHashFunction($hashFunction)
    {
        $hashFunction = strtolower($hashFunction);
        if (!in_array($hashFunction, hash_algos())) {
            throw new \InvalidArgumentException("$hashFunction is not a supported hash function");
        }
        $this->hashFunction = $hashFunction;

        return $this;
    }
public function setHashFunction($hashFunction)
    {
        $hashFunction = strtolower($hashFunction);
        if (!in_array($hashFunction, hash_algos())) {
            throw new \InvalidArgumentException("$hashFunction is not a supported hash function");
        }
        $this->hashFunction = $hashFunction;

        return $this;
    }
public function setHashFunction ( $ hashFunction ) { $ hashFunction = strtolower ( $ hashFunction ) ; if ( ! in_array ( $ hashFunction , hash_algos ( ) ) ) { throw new \ InvalidArgumentException ( "$hashFunction is not a supported hash function" ) ; } $ this -> hashFunction = $ hashFunction ; return $ this ; }
Set the hash function

@param  string  $hashFunction The hash function.
@return self    Returns an instance of self for method chaining.
@throws \InvalidArgumentException Thrown if the supplied hash function
is not supported.
Set the hash function