Preparing search index...

    Function hashIndex

    • Deterministically hashes an index/salt pair to a non-negative integer.

      Pure integer arithmetic (multiply, add, modulo) — no PRNG state and no bitwise operators. The salt decorrelates different fields derived from the same index, so e.g. an entity's persons and time do not move together.

      Parameters

      • index: number

        Entity index within its pool.

      • salt: number

        Field-specific offset that varies output per field.

      Returns number

      A non-negative integer in [0, HASH_MODULUS).