All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
To: "Michał Mirosław" <mirq-linux@rere.qmqm.pl>
Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	netfilter-devel@vger.kernel.org,
	Rusty Russell <rusty@rustcorp.com.au>
Subject: Re: [PATCH] Update jhash.h with the new version of Jenkins' hash
Date: Wed, 11 Feb 2009 23:50:38 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.00.0902112334570.17583@blackhole.kfki.hu> (raw)
In-Reply-To: <20090211201908.GA25398@rere.qmqm.pl>

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@blackhole.kfki.hu, kadlec@mail.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

  reply	other threads:[~2009-02-11 22:50 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-11 10:19 [PATCH] Update jhash.h with the new version of Jenkins' hash Jozsef Kadlecsik
2009-02-11 20:19 ` Michał Mirosław
2009-02-11 22:50   ` Jozsef Kadlecsik [this message]
2009-02-11 23:23     ` Michał Mirosław
2009-02-12  0:12 ` wli
2009-02-12  0:29   ` David Miller
2009-02-12  0:41     ` Jan Engelhardt
2009-02-12  9:05       ` Jarek Poplawski
2009-02-12  9:55         ` Jarek Poplawski
2009-02-12  9:11   ` Jozsef Kadlecsik
2009-02-12  9:16     ` Patrick McHardy
2009-02-12  9:41       ` Jozsef Kadlecsik
2009-02-12 13:46     ` Kyle Moffett
2009-02-17 17:13       ` Jozsef Kadlecsik
2009-02-18  5:11         ` Rusty Russell
2009-02-18 11:50         ` Ilpo Järvinen
2009-02-12 19:58     ` Eric W. Biederman
2009-02-12  2:58 ` Rusty Russell
  -- strict thread matches above, loose matches on Subject: below --
2009-02-10 19:40 Jozsef Kadlecsik
2009-02-10 21:19 ` Scott Feldman
2009-02-10 22:03   ` Jozsef Kadlecsik
2009-02-11  1:17 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.00.0902112334570.17583@blackhole.kfki.hu \
    --to=kadlec@blackhole.kfki.hu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mirq-linux@rere.qmqm.pl \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.