Public Function HashWeinberger(ByRef vzIn As Variant) As Long
Dim nTmp As Long
Dim nRes As Long
Dim i As Integer
Dim xbIn() As Byte
Select Case VarType(vzIn)
Case vbString
xbIn = StrConv(vzIn, vbFromUnicode)
Case vbLong, vbInteger, vbByte, vbDouble, vbSingle
xbIn = StrConv(Trim$(Str$(vzIn)), vbFromUnicode)
Case vbArray Or vbByte
xbIn = vzIn
Case Else
Err.Raise 13
Exit Function
End Select
For i = 0 To UBound(xbIn)
nRes = (nRes * 16) + xbIn(i)
If nRes > 268435456 Then
nTmp = (nRes / 268435456) * 268435456
nRes = nRes + (nTmp / 16777216) - nTmp
End If
Next i
HashWeinberger = nRes
Handler:
End Function