import { cn } from "~/utils/cn"; const HASH_LENGTH = 7; const FNV_OFFSET = 0x811c9dc5; const FNV_PRIME = 0x01000193; const HEX = 16; /** Stable, commit-looking short hash for a section label. */ function shortHash(text: string): string { let hash = FNV_OFFSET; for (const char of text) hash = Math.imul(hash ^ char.charCodeAt(0), FNV_PRIME); return (hash >>> 0).toString(HEX).padStart(HASH_LENGTH, "0").slice(0, HASH_LENGTH); } type Props = { /** Reads like a commit subject, e.g. "feat: review". */ message: string; id?: string; last?: boolean; className?: string; children: React.ReactNode; }; /** * A landing-page section drawn as one entry in `git log --graph`: a rail with a commit node on the * left, the commit subject above the content. */ export function CommitSection({ message, id, last = false, className, children }: Props) { return (

{shortHash(message)} {message}

{children}
); }