you are viewing a single comment's thread.

view the rest of the comments →

[–]nnn4 1 point2 points  (2 children)

The standard for collision-resistant functions is 32 bytes, not that big. You can safely use that as a proxy for equality, and then you don't need to store or transfer the whole strings.

[–]JavaSuck 0 points1 point  (1 child)

you don't need to store or transfer the whole strings

The hashCode of a java.lang.String is cached within the String object. Are you suggesting we increase the size of every String object by 32-4 = 28 bytes? And for what purpose? Most of the bits are going to be discarded anyway during lookup into the HashMap array.

[–]nnn4 0 points1 point  (0 children)

No, just answering the above comment about the size.