code: public function hash(Response $response)
      {
          $params = [
              $response->getLastModified()->format(\DateTime::ISO8601),
          ];
  
          // add cookies to ETag
          if ($this->request_stack->getMasterRequest()) {
              $params[] = http_build_query($this->request_stack->getMasterRequest()->cookies->all());
          }
  
          return hash($this->algorithm, implode(self::ETAG_SEPARATOR, $params));
      }
docs: @param Response $response
  
  @return string