toHash = (buffer, hashFunction) => {
	const hash = createHash(hashFunction);
	hash.update(buffer);
	return /** @type {string} */ (hash.digest("latin1"));
}
@param {Buffer} buffer buffer
@param {string | Hash} hashFunction hash function to use
@returns {string} hash