Hacker News new | past | comments | ask | show | jobs | submit login
Constant time stateless shuffling and grouping (ea.com)
50 points by jasondavies on Sept 6, 2023 | hide | past | favorite | 5 comments



It is the same method that I use in clickhouse-obfuscator: https://github.com/ClickHouse/ClickHouse/tree/master/program...


> The round function can use anything, including destructive operations, so a nice fast hash like PCG is a good choice.

PCG isn't a hash. Maybe they meant FNV?


I searched "PCG Hash" and found this as part of a shader:

  uint PCGHash()
  {
    rng_state = rng_state * 747796405u + 2891336453u;
    uint state = rng_state;
    uint word = ((state >> ((state >> 28u) + 4u)) ^ state) * 277803737u;
    return (word >> 22u) ^ word;
  }
This doesn't look like FNV or any other hash function I know.


How odd. That isn't even a hash function!


Here's the source. Nathan Reed references a jcgt paper, which references a paper form 2012. https://www.reedbeta.com/blog/hash-functions-for-gpu-renderi...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: