Article View: demon.ip.developers
Article #70Re: Newshistory checking
From: Jim Segrave
Date: Thu, 15 Jul 1999 00:00
Date: Thu, 15 Jul 1999 00:00
22 lines
1957 bytes
1957 bytes
In article <19990714.205259.0AA80202.Tuaa@pierrot.co.uk>, Terrance Richard Boyes <tez@pierrot.co.uk> wrote: > Nikki Locke <nikki@trmphrst.demon.co.uk> wrote: > > The efficiency of the hash table depends heavily on the suitability of > > the initial hashing algorithm - if the ID's all hash to different > > numbers, it is very fast. If they all hash to the same number, it is as > > slow as a linear search. > > One problem with message-ids is how to hash them uniquely, they > tend to be relatively large, so any prime-multiplication > type method would result in huge numbers. I did a few experiments > last night with simple things like adding up all the ASCII values > (and a variant splitting the message-id into <lhs@rhs>) and > there is a lot of overflow. I'd recommend algorithms designed to randomise. CRC's are good ones (in another post here I suggested two smaller hash tables rather than one big one), so simply choosing two different CRC polynomials is effective. If you've got more compute power, then an MD5 digest is a potent way of spreading Id's across a range. In either the CRC or MD5 case, simply take as many bits as you want from either the front or the back of the result.
Technical Details
Message-ID:
<E114k8A-0000TK-00@jes.noc.nl.demon.net>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<19990713.200500.0AA80202.PEaa@pierrot.co.uk> <VA.000067f3.00e611c6@trmphrst.demon.co.uk> <19990714.205259.0AA80202.Tuaa@pierrot.co.uk>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10bb05,75d5f9974c0fd91a X-Google-Attributes: gid10bb05,public From: Jim Segrave <jes@nl.demon.net> Subject: Re: Newshistory checking Date: 1999/07/15 Message-ID: <E114k8A-0000TK-00@jes.noc.nl.demon.net> X-Deja-AN: 501297556 X-Mail2News-Path: news.demon.net!binnen.mail.nl.demon.net!jes.noc.nl.demon.net!jes References: <19990713.200500.0AA80202.PEaa@pierrot.co.uk> <VA.000067f3.00e611c6@trmphrst.demon.co.uk> <19990714.205259.0AA80202.Tuaa@pierrot.co.uk> X-Trace: mail2news.demon.nl 932039897 mail2news:13556 mail2news mail2news.demon.nl Organization: Demon Internet Reply-To: jes@nl.demon.net Newsgroups: demon.ip.developers X-Complaints-To: abuse@demon.net