Skip to content

Instantly share code, notes, and snippets.

@zaccone
Created June 15, 2016 13:36
Show Gist options
  • Save zaccone/95795ed7885a7fafa274a53abda5f4d7 to your computer and use it in GitHub Desktop.
Save zaccone/95795ed7885a7fafa274a53abda5f4d7 to your computer and use it in GitHub Desktop.
int hash(const int x, const int y)
{
int hash = 17;
hash = ((hash + x) << 5) - (hash + x);
hash = ((hash + y) << 5) - (hash + y);
return hash;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment