Skip to content

Instantly share code, notes, and snippets.

@AdamWhiteHat
Last active December 22, 2020 10:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AdamWhiteHat/6f11eaf6a9a0f26a4bc49028b9d9fac1 to your computer and use it in GitHub Desktop.
Save AdamWhiteHat/6f11eaf6a9a0f26a4bc49028b9d9fac1 to your computer and use it in GitHub Desktop.
Combine two hashcodes
public static class HashCodeHelper
{
public static int Combine(int h1, int h2)
{
uint num = (uint)((h1 << 5) | (int)((uint)h1 >> 27));
return ((int)num + h1) ^ h2;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment