|
|
|
| |
hashCode
A hashCode is a way of computing a small (32-bit)
digest numeric key from a long String or even
an arbitrary clump of bytes. The numeric key
itself is meaningless and the hashCode functions
for computing them can look a bit insane. However,
when you go to look for something, you can do
the same digest calculation on the long alphabetic
key you are looking for, and no matter how bizarre
an algorithm you used, you will calculate the
same hashCode, and will be able to look up numerically
with it. Of course there is always the possibility
two different Strings will have the same digest
hashCode. However, even then, all is not lost;
it greatly narrows down the search, hence speeding
it up.
|
|