AP Hash

AP is a hybrid rotative and additive hash function algorithm.



									Public Shared Function APHash(str As String) As UInteger
	Dim hash As ULong = &HAAAAAAAAUL
	Dim i As UInteger = 0

	For i = 0 To str.Length - 1
		hash = hash Xor If(((i And 1) = 0), (((hash << 7) Xor CByte(AscW(str(CInt(i)))) * (hash >> 3)) And UInteger.MaxValue), ((Not ((hash << 11) + (CByte(AscW(str(CInt(i)))) Xor (hash >> 5)))) And UInteger.MaxValue))
	Next

	Return hash
End Function
								


Example

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


Output

									2799550922