We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a3abf40 commit 00d344eCopy full SHA for 00d344e
src/core/CCInt.ml
@@ -39,7 +39,7 @@ let hash (n : int) : int =
39
let h = ref offset_basis in
40
for k = 0 to 7 do
41
(h := Int64.(mul !h prime));
42
- (* h := h xor (k-th bit of n) *)
+ (* h := h xor (k-th byte of n) *)
43
h := Int64.(logxor !h (of_int ((n lsr (k * 8)) land 0xff)))
44
done;
45
Int64.to_int !h land max_int
src/core/CCInt64.ml
@@ -16,8 +16,8 @@ let hash_to_int64 (n : t) =
16
17
18
h := mul !h prime;
19
20
- h := logxor !h (logand (shift_left n (k * 8)) 0xffL)
+ h := logxor !h (logand (shift_right n (k * 8)) 0xffL)
21
22
logand !h max_int
23
0 commit comments