dedupeBuffer = buf => {
			const len = buf.length;
			const entry = bufferDedupeMap.get(len);
			if (entry === undefined) {
				bufferDedupeMap.set(len, buf);
				return buf;
			}
			if (Buffer.isBuffer(entry)) {
				if (len < 32) {
					if (buf.equals(entry)) {
						return entry;
					}
					bufferDedupeMap.set(len, [entry, buf]);
					return buf;
				}
				const hash = toHash(entry, this._hashFunction);
				const newMap = new Map();
				newMap.set(hash, entry);
				bufferDedupeMap.set(len, newMap);
				const hashBuf = toHash(buf, this._hashFunction);
				if (hash === hashBuf) {
					return entry;
				}
				return buf;
			} else if (Array.isArray(entry)) {
				if (entry.length < 16) {
					for (const item of entry) {
						if (buf.equals(item)) {
							return item;
						}
					}
					entry.push(buf);
					return buf;
				}
				const newMap = new Map();
				const hash = toHash(buf, this._hashFunction);
				let found;
				for (const item of entry) {
					const itemHash = toHash(item, this._hashFunction);
					newMap.set(itemHash, item);
					if (found === undefined && itemHash === hash) found = item;
				}
				bufferDedupeMap.set(len, newMap);
				if (found === undefined) {
					newMap.set(hash, buf);
					return buf;
				}
				return found;
			}
			const hash = toHash(buf, this._hashFunction);
			const item = entry.get(hash);
			if (item !== undefined) {
				return item;
			}
			entry.set(hash, buf);
			return buf;
		}
@param {Buffer} buf buffer
@returns {Buffer} deduped buffer