From: Joel VanderWerf Date: 2005-05-11T06:32:33+09:00 Subject: Re: String Hashing Algorithms Phrogz wrote: > Joel VanderWerf wrote: > >>Phrogz wrote: >> >>>A brief analysis of Ruby versions of a few string hashing > > algorithms, > >>>and my conclusions about their efficacy at preventing collisions. >> >>Is ruby's own String#hash one of the ones you tested? If not, how > > does > >>it compare? > > > Because I was interested in C algorithms, I didn't consider it. But, I > just ran it again, and ruby came out with the best of them: > > ruby :: 100.0000 percent coverage (0 collisions out of 42884) > It is coded in C, and looking at rb_str_hash() in string.h, I see that it is one of HASH_ELFHASH, HASH_PERL, or a third (very simple) one.