src/utils.js
function generateETag(body, opt) {
	if (_.isFunction(opt))
		return opt.call(this, body);

	let buf = !Buffer.isBuffer(body)
		? Buffer.from(body)
		: body;

	return etag(buf, (opt === true || opt === "weak") ? { weak: true } : null);
}
function generateETag(body, opt) {
	if (_.isFunction(opt))
		return opt.call(this, body);

	let buf = !Buffer.isBuffer(body)
		? Buffer.from(body)
		: body;

	return etag(buf, (opt === true || opt === "weak") ? { weak: true } : null);
}
function generateETag ( body , opt ) { if ( _ . isFunction ( opt ) ) return opt . call ( this , body ) ; let buf = ! Buffer . isBuffer ( body ) ? Buffer . from ( body ) : body ; return etag ( buf , ( opt === true || opt === "weak" ) ? { weak : true } : null ) ; }
Generate ETag from content.

@param {any} body
@param {Boolean|String|Function?} opt

@returns {String}
Generate ETag from content .