in reply to Re: Generating A Hash Value
in thread Generating A Hash Value

Two things:
  1. You don't have to wonder, you can read it for yourself.
  2. Seondly, and more importantly, the way the hashCode() method works in java allows for objects of any type to serve as hash keys. The original poster asked a question about the implementation of that method for Strings. (also: Perl allows for arbitrarily long hash keys, too, since any strings are hash keys, and strings are arbitrarily long)
  3. Three things: there is no third thing.

Replies are listed 'Best First'.
Re: Re: Re: Generating A Hash Value
by thor (Priest) on Jul 03, 2003 at 23:51 UTC
    To address your items, point by point:
    1. I could have, but I'm lazy. And laziness is a virtue.
    2. I understand what purpose hashCode() has. However, in perl, hash codes are not of arbitrary length. There is an algorithm described here that describes an algorithm that takes an arbitrary input and produces a 32-bit hash code. A bit slower, I suppose, but keeps you from having to keep track of an arbitrarily large integer for your hash key. So, it's not necessarily the case that one use arbitrarily large hash codes (which is different from arbitrarily large hash keys)
    3. Good, because I don't either...:).
    4. thor