Article View: demon.ip.developers
Article #72Re: Newshistory checking
From: Nikki Locke
Date: Thu, 15 Jul 1999 00:00
Date: Thu, 15 Jul 1999 00:00
22 lines
2020 bytes
2020 bytes
In article <19990714.205259.0AA80202.Tuaa@pierrot.co.uk>, Terrance Richard Boyes wrote: > 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. Try a CRC - that might work better. Or just extract the first n digits from the ID, modulus some prime number. If you use a linked list of matching hashes inside each hash table node, you can get pretty efficient. If you only have 32K entries, I imagine almost any reasonable method is going to be reasonably quick on a modern computer. I would try something fairly primitive out, and only worry about the finer details if you find a performance problem. If you lookup is properly isolated from the rest of the program, you can always tweak it later if there is a problem. -- Nikki Locke, Trumphurst Ltd. PC & Unix consultancy & programming nikki@trmphrst.demon.co.uk http://www.trumphurst.com/
Technical Details
Message-ID:
<VA.000067fd.00f73479@trmphrst.demon.co.uk>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: Nikki Locke <nikki@trmphrst.demon.co.uk> Subject: Re: Newshistory checking Date: 1999/07/15 Message-ID: <VA.000067fd.00f73479@trmphrst.demon.co.uk> X-Deja-AN: 501299972 Content-Transfer-Encoding: 8bit X-NNTP-Posting-Host: trmphrst.demon.co.uk:158.152.8.60 References: <19990713.200500.0AA80202.PEaa@pierrot.co.uk> <VA.000067f3.00e611c6@trmphrst.demon.co.uk> <19990714.205259.0AA80202.Tuaa@pierrot.co.uk> Content-Type: text/plain; charset=iso-8859-1 X-Complaints-To: abuse@demon.net X-Trace: news.demon.co.uk 932040142 nnrp-08:9742 NO-IDENT trmphrst.demon.co.uk:158.152.8.60 Organization: Trumphurst Ltd. Mime-Version: 1.0 Reply-To: nikki@trmphrst.demon.co.uk Newsgroups: demon.ip.developers