strange hash behavior

Ralph Boland rpboland at gmail.com
Thu Nov 30 18:00:06 UTC 2006


>
>         Hi list,
>
> I just stumbled upon this:
>
> Object new hash 3698
> OrderedCollection new hash 183475190
>
> Hashes for collections seems to be much bigger than other hashes. Is
> there a reason for that?
>
> Cheers,
>         Romain
>

In my application this causes major problems.
In the case of class Character I created two arrays on the
class side of Character.  The first array stored
30 bit hash values, one or for each character.
The second array stores the the Xor  of the first
k character hash values in position k.  This  allows
me to compute a hash value for a range of characters
quickly.
Using these arrays to determine hash values for characters
solved my hash value problems, as least for
Character class objects.

Ralph
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20061130/40550fe1/attachment.htm


More information about the Squeak-dev mailing list