File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ let hash (n : int) : int =
3939 let h = ref offset_basis in
4040 for k = 0 to 7 do
4141 (h := Int64. (mul ! h prime));
42- (* h := h xor (k-th bit of n) *)
42+ (* h := h xor (k-th byte of n) *)
4343 h := Int64. (logxor ! h (of_int ((n lsr (k * 8 )) land 0xff )))
4444 done ;
4545 Int64. to_int ! h land max_int
Original file line number Diff line number Diff line change @@ -16,8 +16,8 @@ let hash_to_int64 (n : t) =
1616 let h = ref offset_basis in
1717 for k = 0 to 7 do
1818 h := mul ! h prime;
19- (* h := h xor (k-th bit of n) *)
20- h := logxor ! h (logand (shift_left n (k * 8 )) 0xffL )
19+ (* h := h xor (k-th byte of n) *)
20+ h := logxor ! h (logand (shift_right n (k * 8 )) 0xffL )
2121 done ;
2222 logand ! h max_int
2323
You can’t perform that action at this time.
0 commit comments