From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Neil Brown <neilb@cse.unsw.edu.au>
Cc: Linus Torvalds <torvalds@transmeta.com>,
Linux Kernel List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] Define hash_mem in lib/hash.c to apply hash_long to an arbitraty piece of memory.
Date: 06 Jan 2003 23:33:23 -0800 [thread overview]
Message-ID: <1041924803.27637.3.camel@ixodes.goop.org> (raw)
In-Reply-To: <15898.24480.346258.361959@notabene.cse.unsw.edu.au>
On Mon, 2003-01-06 at 21:03, Neil Brown wrote:
> Seeing as we have a simple, elegant, and effective hash_long in
> hash.h, and seeing that I need to hash things that aren't a long
> (i.e. strings), I would like to propose defining "hash_mem" based on
> hash_long as done in the following patch (hash_mem already exists
> local to net/sunrpc/svcauth.c, this patch tidies it up and moves it to
> lib/hash.c).
>
> It could be argued that there are better hashing functions for
> strings, and indeed Andrew Morton pointed me to ext3/hash.c
>
> I did a little testing and found that on a list of 2 million
> basenames from a recent backup index (800,000 unique):
>
> hash_mem (as included here) is noticably faster than HASH_HALF_MD4 or
> HASH_TEA:
>
> hash_mem: 10 seconds
> DX_HASH_HALF_MD4: 14 seconds
> DX_HASH_TEA: 15.2 seconds
I think they have a different set of design requirements. They're both
designed to not only generate hashes, but make the hashes
cryptographically strong (ie, impossible to generate collisions with
less effort than brute force). They're naturally slower than a simple
hash, so you'd only use them if you need the stronger requirements.
J
next prev parent reply other threads:[~2003-01-07 7:24 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-01-07 5:03 [PATCH] Define hash_mem in lib/hash.c to apply hash_long to an arbitraty piece of memory Neil Brown
2003-01-07 5:18 ` Falk Hueffner
2003-01-07 5:31 ` Aaron Lehmann
2003-01-07 6:07 ` Neil Brown
2003-01-07 6:44 ` Linus Torvalds
2003-01-07 7:33 ` Jeremy Fitzhardinge [this message]
2003-01-07 7:45 ` Linus Torvalds
2003-01-08 0:00 ` Neil Brown
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=1041924803.27637.3.camel@ixodes.goop.org \
--to=jeremy@goop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=neilb@cse.unsw.edu.au \
--cc=torvalds@transmeta.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox