export function normalizeText(text: string): string {
  return text.replace(/\s+/g, " ").trim().toLocaleLowerCase();
}

export function hashText(text: string): string {
  const normalized = normalizeText(text);
  let hash = 2166136261;
  for (let index = 0; index < normalized.length; index += 1) {
    hash ^= normalized.charCodeAt(index);
    hash = Math.imul(hash, 16777619);
  }
  return (hash >>> 0).toString(16).padStart(8, "0");
}
