private function getHash($stream, $algorithm = 'sha256')
    {
        $hash = hash_init($algorithm);
        hash_update_stream($hash, $stream);

        return hash_final($hash);
    }
private function getHash($stream, $algorithm = 'sha256')
    {
        $hash = hash_init($algorithm);
        hash_update_stream($hash, $stream);

        return hash_final($hash);
    }
private function getHash ( $ stream , $ algorithm = 'sha256' ) { $ hash = hash_init ( $ algorithm ) ; hash_update_stream ( $ hash , $ stream ) ; return hash_final ( $ hash ) ; }
Returns hash for resource.

@param resource $stream
@param string $algorithm

@return string
Returns hash for resource .