/**
 * FNV-1a 32-bit hash — fast, non-cryptographic content hash.
 *
 * Used for cache keys, content fingerprinting, and provenance tracking.
 * Returns an 8-character zero-padded hex string.
 *
 * Shared across fixture-resolver, variable-resolver, and trace-store
 * to ensure consistent hash behavior. Uses unsigned right shift (`>>> 0`)
 * to keep the hash in unsigned 32-bit integer range.
 */
export function simpleHash(content) {
    let hash = 0x811c9dc5; // FNV-1a offset basis
    for (let i = 0; i < content.length; i++) {
        hash ^= content.charCodeAt(i);
        hash = (hash * 0x01000193) >>> 0; // FNV prime, unsigned 32-bit
    }
    return hash.toString(16).padStart(8, "0");
}
