FNV Hash
FNV is a hash function algorithm.
public static uint FNVHash(string str)
{
const uint fnv_prime = 0x811C9DC5;
uint hash = 0;
uint i = 0;
for (i = 0; i < str.Length; i++)
{
hash *= fnv_prime;
hash ^= ((byte)str[(int)i]);
}
return hash;
}
Example
string data = "jdfgsdhfsdfsd 6445dsfsd7fg/*/+bfjsdgf%$^";
uint value = FNVHash(data);
Output
2267144173