java - Hash map keys are not random -
it seems java's implementation of hashmap always places keys same bins (at least saw integer keys). i.e. hashing deterministic , in runs produces same value.
have heard languages randomize insertions in bucket key stored unpredictable security reasons.
why java keys same?
this not true java 7, added unique hash seed each hashmap instance. there's more information on collections framework enhancements in java se 7 page.
this mechanism removed in java 8 performance, , replaced alternative converts comparable keys (such string) balanced tree elide dos security problem. there's more information on collections framework enhancements in java se 8 page.
Comments
Post a Comment