RS Hash

RS is a hash function algorithm.



									public static uint RSHash(string str)
{
	uint b = 378551;
	uint a = 63689;
	uint hash = 0;
	uint i = 0;

	for (i = 0; i < str.Length; i++)
	{
		hash = hash * a + ((byte)str[(int)i]);
		a *= b;
	}

	return hash;
}
								


Example

									string data = "jdfgsdhfsdfsd 6445dsfsd7fg/*/+bfjsdgf%$^";
uint value = RSHash(data);
								


Output

									2012450421