Last active
January 23, 2022 18:55
-
-
Save Job79/db9f089704bb288e7734b609d6839576 to your computer and use it in GitHub Desktop.
djba2 implementation c#
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 int Hash(this string str) | |
{ | |
int hash = 5381; | |
foreach (var t in str) hash = ((hash << 5) + hash) ^ (byte) t; | |
return hash; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment