Does the hash code function in String.hashCode() ever repeat?
book
Article ID: KB0094272
calendar_today
Updated On:
Products
Versions
TIBCO BusinessEvents Enterprise Edition
-
Not Applicable
-
Description
Resolution: Description: ============ Does the hash code ever repeat or is it a perfect hash?
Environment: ========== All
Symptoms: ========= N/A
Resolution: ========= The hash code will eventually repeat. The biggest integer is 10 characters however the biggest string is 2 billion characters. In addition one has to consider all of the combinations you can get in a 2 billion character strings so the hash value returned will eventually repeat.
Issue/Introduction
Does the hash code function in String.hashCode() ever repeat?