Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback


The Deno Standard Library
Go to Latest
import * as mod from "";

Provides functions for dealing with and matching ETags, including calculate to calculate an etag for a given entity, ifMatch for validating if an ETag matches against a If-Match header and ifNoneMatch for validating an Etag against an If-None-Match header.

See further information on the ETag header on MDN.


Calculate an ETag for an entity. When the entity is a specific set of data it will be fingerprinted as a "strong" tag, otherwise if it is just file information, it will be calculated as a weak tag.

A helper function that takes the value from the If-Match header and a calculated etag for the target. By using strong comparison, return true if the values match, otherwise false.

A helper function that takes the value from the If-None-Match header and a calculated etag for the target entity and returns false if the etag for the entity matches the supplied value, otherwise true.


Options for calculate.

Just the part of Deno.FileInfo that is required to calculate an ETag, so partial or user generated file information can be passed.

Type Aliases

Represents an entity that can be used for generating an ETag.