JS Hash

JS is a bitwise hash function algorithm.



									Public Shared Function JSHash(str As String) As UInteger
	Dim hash As ULong = 1315423911
	Dim i As UInteger = 0

	For i = 0 To str.Length - 1
		hash = ((hash Xor ((hash << 5) + CByte(AscW(str(CInt(i)))) + (hash >> 2))) And UInteger.MaxValue)
	Next

	Return hash
End Function
								


Example

									Dim data = "jdfgsdhfsdfsd 6445dsfsd7fg/*/+bfjsdgf%$^"
Dim value = JSHash(data)
								


Output

									3189953700