October 2018 archive

Java HashMap.hashCode() Not Unique With String Keys And Values

Java’s HashMap (AbstractMap really) hashCode() implementation sums the hash codes of its entries rather than multiplies them by a prime number like String.hashCode() does. This can cause weird collisions in very similar maps.

Continue reading


Good news: I survived. Life’s much better now than the last time we spoke. Thanks for asking. Also good news: I’m cleaning up the site / blog a bit, trying to bring it up to at least a 2012 fashionable look, and I’ve been working on a fun book.

Continue reading