209 |
|
|
210 |
|
|
211 |
let bloom_hash_magic = Int32.of_string "0x4F1BBCDC" |
let bloom_hash_magic = Int32.of_string "0x4F1BBCDC" |
212 |
let bloom_hash_magic_int64 = Int64ops.int64_of_uint32 bloom_hash_magic |
let bloom_hash_magic_int64 = int64_of_uint32 bloom_hash_magic |
213 |
|
|
214 |
let bloom_hash_fast x bits = |
let bloom_hash_fast x bits = |
215 |
let xx = Int64ops.int64_of_uint32 x in |
let xx = int64_of_uint32 x in |
216 |
let prod = Int64.mul xx bloom_hash_magic_int64 in |
let prod = xx ** bloom_hash_magic_int64 in |
217 |
let ret = Int64.shift_left prod 32 in (* prod << 32 *) |
let ret = Int64.shift_left prod 32 in (* prod << 32 *) |
218 |
Int64.shift_right_logical ret (32 + (32 - bits)) (* ret >>> (32 + (32 - bits)) *) |
Int64.shift_right_logical ret (32 + (32 - bits)) (* ret >>> (32 + (32 - bits)) *) |
219 |
|
|