On Sat, Aug 3, 2019 at 1:35 AM Jon Zeppieri <zeppi...@gmail.com> wrote: > > On Sat, Aug 3, 2019 at 12:52 AM Jesse Wang <hello....@gmail.com> wrote: > > > > If I want to turn the hash code into array index in a hash table, do I need > > to > > apply another uniform hash function such as md5 on the result of > > equal-hash-code? > > > > That wouldn't accomplish anything. [...]
Sorry! My response assumed that you're concerned with the hash codes themselves colliding, but of course you're concerned about the codes modulo the length of the table (or bit-masked) colliding. (I've been thinking too much about immutable hashes lately, which aren't actually hash tables.) So, yes, applying a cryptographic hash function to the result could help with this case, but at some point you need to consider whether the improvement is worth the cost. Cryptographic hash functions are usually a lot more expensive to compute than the hash functions commonly used in hash tables. --- I just saw your response. If you're concerned about performance, you should try it out and measure. Collisions certainly do slow down hash tables, but so do expensive hash functions. It's a trade-off. -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/CAKfDxxwm2PqGKu-PWyd5TtqiCpJy%2BWVeAimAUkOU3dtJqMOKNg%40mail.gmail.com.