Skip to content

Instantly share code, notes, and snippets.

@RYSF13
Created January 5, 2026 10:50
Show Gist options
  • Select an option

  • Save RYSF13/b3a610263c4916e7079dde77244d82dd to your computer and use it in GitHub Desktop.

Select an option

Save RYSF13/b3a610263c4916e7079dde77244d82dd to your computer and use it in GitHub Desktop.
A simple custom 32-bit non-cryptographic hash function in C
// R01-hash
r01h(d,l)char*d;{int h=0x9E3779B1;for(i=0;i<l;i++)h=(h<<5)|(h>>27),h^=
d[i],h+=(h<<12)^(h>>22),h*=0xCC9E2D51;h^=h>>17;h*=0x1B873593;h^=h>>3;}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment