Skip to content

Instantly share code, notes, and snippets.

@umdstu
Created April 8, 2013 11:53
Show Gist options
  • Save umdstu/5336273 to your computer and use it in GitHub Desktop.
Save umdstu/5336273 to your computer and use it in GitHub Desktop.
def jhc(str)
t = 0
s = str
n = s.size
(0..n-1).each do |i|
t += s[i].ord * (31**(n-1))
end
puts t
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment