/[mldonkey]/mldonkey/src/networks/gnutella/gnutellaProtocol.ml
ViewVC logotype

Diff of /mldonkey/src/networks/gnutella/gnutellaProtocol.ml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.16 by spiralvoice, Fri Jul 22 10:58:55 2005 UTC revision 1.17 by spiralvoice, Sun Oct 16 20:42:54 2005 UTC
# Line 209  let set_gnutella_sock sock info ghandler Line 209  let set_gnutella_sock sock info ghandler
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    

Legend:
Removed from v.1.16  
changed lines
  Added in v.1.17

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26