[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.00.0902112334570.17583@blackhole.kfki.hu>
Date: Wed, 11 Feb 2009 23:50:38 +0100 (CET)
From: Jozsef Kadlecsik <kadlec@...ckhole.kfki.hu>
To: Michał Mirosław <mirq-linux@...e.qmqm.pl>
cc: linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
netfilter-devel@...r.kernel.org,
Rusty Russell <rusty@...tcorp.com.au>
Subject: Re: [PATCH] Update jhash.h with the new version of Jenkins' hash
On Wed, 11 Feb 2009, Micha? Miros?aw wrote:
> On Wed, Feb 11, 2009 at 11:19:20AM +0100, Jozsef Kadlecsik wrote:
> > /* The golden ration: an arbitrary value */
> > -#define JHASH_GOLDEN_RATIO 0x9e3779b9
> > +#define JHASH_GOLDEN_RATIO 0xdeadbeef
>
> I have a stupid question: if this is arbitrary value, then why not
> just get rid of it (IOW use zero as it's used in addition)?
lookup3() is a quite generic hash function and it supports 0-byte strings
as input keys too. If the input key is a 0-byte string and the arbitrary
value is zero, then the hash value simply equal to the initval. In order
to avoid that case, the arbitrary value must be nonzero.
Best regards,
Jozsef
-
E-mail : kadlec@...ckhole.kfki.hu, kadlec@...l.kfki.hu
PGP key : http://www.kfki.hu/~kadlec/pgp_public_key.txt
Address : KFKI Research Institute for Particle and Nuclear Physics
H-1525 Budapest 114, POB. 49, Hungary
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists