function etag(entity, options) {
  if (entity == null) {
    throw new TypeError('argument entity is required')
  }

  var isStats = isstats(entity)
  var weak = options && typeof options.weak === 'boolean'
    ? options.weak
    : isStats

  // support fs.Stats object
  if (isStats) {
    return stattag(entity, weak)
  }

  if (typeof entity !== 'string' && !Buffer.isBuffer(entity)) {
    throw new TypeError('argument entity must be string, Buffer, or fs.Stats')
  }

  var hash = weak
    ? weakhash(entity)
    : stronghash(entity)

  return weak
    ? 'W/"' + hash + '"'
    : '"' + hash + '"'
}
Create a simple ETag.

@param {string|Buffer|Stats} entity
@param {object} [options]
@param {boolean} [options.weak]
@return {String}
@api public