Advertisement
ZeekoSec

Jenkins Hash

Apr 7th, 2015
591
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.37 KB | None | 0 0
  1. Private Function jenkins_one_at_a_time_hash(key As Pointer(Of Char), len As size_t) As uint32_t
  2.     Dim hash As uint32_t, i As uint32_t
  3.     hash = InlineAssignHelper(i, 0)
  4.     While i < len
  5.         hash += key(i)
  6.         hash += (hash << 10)
  7.         hash = hash Xor (hash >> 6)
  8.         i += 1
  9.     End While
  10.     hash += (hash << 3)
  11.     hash = hash Xor (hash >> 11)
  12.     hash += (hash << 15)
  13.     Return hash
  14. End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement