Skip to content

Instantly share code, notes, and snippets.

@Job79
Last active January 23, 2022 18:55
Show Gist options
  • Save Job79/db9f089704bb288e7734b609d6839576 to your computer and use it in GitHub Desktop.
Save Job79/db9f089704bb288e7734b609d6839576 to your computer and use it in GitHub Desktop.
djba2 implementation c#
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