getHash = (str, len, hashFunction) => {
	const hash = createHash(hashFunction);
	hash.update(str);
	const digest = /** @type {string} */ (hash.digest("hex"));
	return digest.slice(0, len);
}
@param {string} str string to hash
@param {number} len max length of the hash
@param {string | Hash} hashFunction hash function to use
@returns {string} hash