hashKeys
hashKeys(…
keys):number
Defined in: packages/engine/src/maths/hash.ts:24
A number from 0 to 1, never 1, that its integer keys alone decide: a
seed, a grid cell and which draw, say. A generated field draws from it
rather than from a random stream. Integer arithmetic is exact in every
JavaScript engine, where Math.sin is not, so a cell hashes the same on
every device, and a change beside it leaves it where it is.
Each key is mixed before the fold and the fold is mixed after, so two key lists collide only by chance, at a random 32-bit hash’s rate, never as a pattern of shifted cells. The constant between keys makes key order count. The fold starts at the key count because zero mixes to zero.
Down here because the scatter’s placement and the cloud field both stand on it, and those sit in layers that cannot import each other.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
…keys |
number[] |
Returns
Section titled “Returns”number