Chandler Carruth <[email protected]> writes: > Bernstein's hash happens to be effective of short strings of *ascii* printable > characters. It is not highly rilient to single bit flips in all bits of the > input. Notably, as pointed out by Bob Jenkins and others, there is a funnel > where 0x21 and 0x100 have the same hash (33). Bernstein's hash became popular > in no small part because it has unusual properties with *ascii* text: > lowercase alpha strings of 6 characters or smaller have zero collisions in > 32-bits. I don't see any way that it is a useful hashing algorithm for > something like this. > > FNV is slightly better in that it works for any byte stream rather than being > carefully chosen to work with ascii characters. This is primarily because it > uses a prime multiplier. However, it *requires* fast integer multiplies (and > thus is often quite slow on non-Intel chips) and has a tendency to scale > *very* poorly to large input messages due to the byte-stream nature of the > beast.
Interesting stuff. Thanks for the enlightenment. _______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
