Skip to content

Beautiful, AI-native markdown IDE and LLM wiki

226 B
Raw Blame
export function fnv1aDigest(s: string): string {
  let h = 0x811c9dc5;
  for (let i = 0; i < s.length; i++) {
    h ^= s.charCodeAt(i);
    h = Math.imul(h, 0x01000193);
  }
  return (h >>> 0).toString(16).padStart(8, '0');
}