Last active
December 22, 2020 10:28
-
-
Save AdamWhiteHat/6f11eaf6a9a0f26a4bc49028b9d9fac1 to your computer and use it in GitHub Desktop.
Combine two hashcodes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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