Question to Cache::Memcached
Evan Martin
martine@danga.com
Tue, 8 Jun 2004 12:42:19 -0700
On Tue, Jun 08, 2004 at 11:06:23AM -0700, Brad Fitzpatrick wrote:
> Can you change it to this:
>
> $hash = ($hash*33 + ord($_)) % (2 ** 31);
>
> That should work, right? *scratchs head*
Or maybe
unpack('L', pack('L', $hash*33 + ord($_)))
to avoid division?
I could've sworn Perl exposed its internal hash function that it uses
for its own hashes--I think the similar languages do.
--
Evan Martin
martine@danga.com
http://neugierig.org