ELF Hash
ELF is a hash function algorithm.
Public Shared Function ELFHash(str As String) As UInteger
Dim hash As UInteger = 0
Dim x As UInteger = 0
Dim i As UInteger = 0
For i = 0 To str.Length - 1
hash = (hash << 4) + CByte(AscW(str(CInt(i))))
x = hash And &HF0000000UI
If x <> 0 Then
hash = hash Xor (x >> 24)
End If
hash = hash And Not x
Next
Return hash
End Function
Example
Dim data = "jdfgsdhfsdfsd 6445dsfsd7fg/*/+bfjsdgf%$^"
Dim value = ELFHash(data)
Output
248446350