Article View: news.software.nntp
Article #25025Re: Cleanfeed hashing
From: Kenneth Herron
Date: Thu, 08 Jan 1998 00:00
Date: Thu, 08 Jan 1998 00:00
46 lines
2051 bytes
2051 bytes
In article <87u3bfyf3m.fsf@erlenstar.demon.co.uk>,
Andrew Gierth <andrew@erlenstar.demon.co.uk> wrote:
|
| Kenneth> I've been hacking heavily on cleanfeed and have experimented
| Kenneth> with perl's built-in CRC generator.
| [...]
| Kenneth> unpack('%24S*', $hash)
|
|That is not a CRC, it's a simple additive checksum.
Well, *that's* embarassing...somehow I got the idea it was a CRC.
No wonder it was behaving like a checksum during tests :-)
Even so, using a sample consisting of the entire contents of
alt.sex, misc.jobs.offered, and alt.business.multi-level (13,386
articles just now), I'm getting two false positives using:
$sbody = substr($body, 0, 8192);
$sbody =~ tr/A-Z`~!@#$%^&*()_+=[{]}|;:'",<.>?-/a-z./s;
$key = join($;, length($body) >> 5, length($sbody),
unpack('%24S*', $sbody))
viz:
15c15
< POSITION ID: 703336
---
> POSITION ID: 703435
and
23c23
< Skills Required: VB, MS SQL, Access, NT, stored prodecures
---
> Skills Required: VB, MS SQL, Access, NT, stored procedures
Better, I'm getting no false positives using
[...]
$key = join($;, length($body) >> 5, length($sbody),
unpack('%32L*', $sbody))
and it's a hair faster than the '%24S*' version.
--
Kenneth Herron -- kherron@campus.mci.net
No animals were harmed during the production of this message.
Technical Details
Message-ID:
<691h7b$71b$1@news.campus.mci.net>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mailReferences:
<000034AD3C93.NO_UCE@mauve.demon.co.uk> <68muc9$aun$1@shell.monmouth.com> <68ucnc$abl$1@news.campus.mci.net> <87u3bfyf3m.fsf@erlenstar.demon.co.uk>Show Full Headers
Complete Article Headers
Message-ID: <691h7b$71b$1@news.campus.mci.net> Subject: Re: Cleanfeed hashing Date: Thu, 08 Jan 1998 00:00:00 +0000 From: kherron@campus.mci.net (Kenneth Herron) References: <000034AD3C93.NO_UCE@mauve.demon.co.uk> <68muc9$aun$1@shell.monmouth.com> <68ucnc$abl$1@news.campus.mci.net> <87u3bfyf3m.fsf@erlenstar.demon.co.uk> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail X-Deja-AN: 313827591 X-Newsposter: trn 4.0-test54 (18 Feb 97) Distribution: inet Organization: CampusMCI Newsgroups: news.software.nntp