function calculate
calculate(entity: Entity,options?: ETagOptions): Promise<string | undefined>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.
import { calculate } from "@std/http/etag"; import { assert } from "@std/assert/assert" const body = "hello deno!"; const etag = await calculate(body); assert(etag); const res = new Response(body, { headers: { etag } });
Parameters
entity: Entityoptional
options: ETagOptions