Verified Commit 60347b42 authored by Camil Staps's avatar Camil Staps 🙂

Fix computation of hash for end of string in murmurHash

parent 91c5870a
Pipeline #43920 passed with stage
in 7 minutes and 10 seconds
......@@ -51,13 +51,7 @@ murmurHash_64 s
# h = runblocks 0 mainlen h
# restlen = len bitand 7
# rest = get_int_from_string mainlen s
# rest = if (restlen<=3)
(if (restlen<=1)
(if (restlen==0) 0 (rest bitand 0xff))
(if (restlen==2) (rest bitand 0xffff) (rest bitand 0xffffff)))
(if (restlen<=5)
(if (restlen==4) (rest bitand 0xffffffff) (rest bitand 0xffffffffff))
(if (restlen==6) (rest bitand 0xffffffffffff) rest))
# rest = rest bitand ((1<<(restlen<<3))-1)
# h = (h bitxor rest) * M
# h = h bitxor (h shiftrU R)
# h = h * M
......@@ -91,9 +85,7 @@ murmurHash_32 s
# h = runblocks 0 mainlen h
# restlen = len bitand 3
# rest = get_int_from_string mainlen s
# rest = if (restlen<=1)
(if (restlen==0) 0 (rest bitand 0xff))
(if (restlen==2) (rest bitand 0xffff) rest)
# rest = rest bitand ((1<<(restlen<<3))-1)
# h = (h bitxor rest) * M
# h = h bitxor (h shiftrU 13)
# h = h * M
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment