Skip to content

Instantly share code, notes, and snippets.

@yocontra
Created February 26, 2013 15:48
Show Gist options
  • Save yocontra/5039487 to your computer and use it in GitHub Desktop.
Save yocontra/5039487 to your computer and use it in GitHub Desktop.
djb2 hashing in julia
function djb2(s)
r = 5381
for i in s
c = int(i)
r = r + (r << 5) + c
end
return r
end
println(djb2("test"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment