lib/remcached.rb in astro-remcached-0.2.0 vs lib/remcached.rb in astro-remcached-0.2.1
- old
+ new
@@ -42,12 +42,14 @@
end
end
def hash_key(key)
hashed = 0
- key.bytes.each_with_index do |b, i|
+ i = 0
+ key.each_byte do |b|
j = key.length - i - 1 % 4
hashed ^= b << (j * 8)
+ i += 1
end
hashed
end
def operation(op, contents, &callback)