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 =
39
39
let h = ref offset_basis in
40
40
for k = 0 to 7 do
41
41
(h := Int64. (mul ! h prime));
42
- (* h := h xor (k-th bit of n) *)
42
+ (* h := h xor (k-th byte of n) *)
43
43
h := Int64. (logxor ! h (of_int ((n lsr (k * 8 )) land 0xff )))
44
44
done ;
45
45
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) =
16
16
let h = ref offset_basis in
17
17
for k = 0 to 7 do
18
18
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 )
21
21
done ;
22
22
logand ! h max_int
23
23
You can’t perform that action at this time.
0 commit comments