You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@spamassassin.apache.org by Daniel Quinlan <qu...@pathname.com> on 2004/04/14 23:01:56 UTC

non-random t/rule_tests.t

Justin,

Using a constant seed isn't really going to make this non-random since
the number of elements changes every time a rule is deleted or added.  I
haven't actually analyzed Fisher-Yates, but I suspect the ordering will
radically change when a rule is added or removed.

If you want something non-random, I'd suggest replacing the shuffle with
a sort by sha1(rule name) taking a different substr of the sha1 result
for each of the 10 iterations (which are needed).  That should be very
stable when rules are added, deleted, or removed, but should be
sufficiently random-like so high-FP rule names will be caught.

Daniel

-- 
Daniel Quinlan                     anti-spam (SpamAssassin), Linux,
http://www.pathname.com/~quinlan/    and open source consulting