TizzyT

UInt64 8bit Hash -TizzyT

Jul 5th, 2015
361
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.32 KB | None | 0 0
  1.     Public Function UInt64_Hash(ByVal Value As UInt64, Optional ByVal XorVal As Byte = 170) As Byte
  2.         Dim ValueBytes() As Byte = BitConverter.GetBytes(Value)
  3.         Dim HashCode As Int16 = ValueBytes(0)
  4.         For i = 1 To 7 : HashCode += ValueBytes(i) Xor XorVal : Next
  5.         Return HashCode Mod 256
  6.     End Function
Advertisement
Add Comment
Please, Sign In to add comment