async function etag(entity) {
  const isStrong =
    Buffer.isBuffer(entity) ||
    typeof (/** @type {ReadStream} */ (entity).pipe) === "function";

  return isStrong
    ? entityTag(/** @type {Buffer | ReadStream} */ (entity))
    : statTag(/** @type {import("fs").Stats} */ (entity));
}
Create a simple ETag.
@param {Buffer | ReadStream | Stats} entity entity
@returns {Promise<{ hash: string, buffer?: Buffer }>} etag