[Caml-list] range of hash function

2010-02-20 Thread Grégoire Seux
hello ! i would like to use the polymorhpic hash function on strings. But i would like to know what is the probability of a collision between two hashes. my first question is about the range of the Hashtbl.hash function: what is its range ? ( string -> [1..N] ?) the second question is : can i as

Re: [Caml-list] range of hash function

2010-02-20 Thread Goswin von Brederlow
Grégoire Seux writes: > hello ! > > i would like to use the polymorhpic hash function on strings. But i would like > to know what is the probability of a collision between two hashes.  > > my first question is about the range of the Hashtbl.hash function: what is its > range ? ( string -> [1..N

Re: [Caml-list] range of hash function

2010-02-20 Thread ygrek
On Sat, 20 Feb 2010 11:52:05 +0100 Goswin von Brederlow wrote: > Grégoire Seux writes: > > > hello ! > > > > i would like to use the polymorhpic hash function on strings. But i would > > like > > to know what is the probability of a collision between two hashes.  > > > > my first question is

Re: [Caml-list] range of hash function

2010-02-20 Thread Jacques Garrigue
From: Grégoire Seux > i would like to use the polymorhpic hash function on strings. But i would > like to know what is the probability of a collision between two hashes. > > my first question is about the range of the Hashtbl.hash function: what is > its range ? ( string -> [1..N] ?) Just to get

Re: [Caml-list] range of hash function

2010-02-21 Thread Richard Jones
On Sat, Feb 20, 2010 at 10:54:12PM +0900, Jacques Garrigue wrote: > Since you have the algorithm, you can predict collisions. Basically > shifting character n by 1 is equivalent to shifting character n+1 by > 19, so you have lots of collisions. But this hash function being > intended for hashtables