in reply to Temporarily Obscuring a Lottery Draw
If I understand your question correct, then you only need to discover repeated pairings, no need to save the concrete names (but see below) ?
You could normalise a pair (e.g. sort alphabetically → "Lois,Tarzan" or "Clark,Jane"), pipe that through an MD5 or SHA1 and save this obfuscated pair (e.g. a line of hex digits: affe8deadbeef0815.... etc.) into a text file. It should be obfuscated enough to scare the occasional snoop. Your script would test for a duplicate by generating the hash for the pair to test and look it up in the list of historical pairings hashes. When found, start a new draw.
Instead of running an eMail distribution-script once a year, run the Secret Santa script once a year and let it send the eMails in the same turn. After the script terminates, the concrete names are lost, but the file is updated with a couple of new pairings (hashes) to avoid duplicated pairings for next year's run. If your number of pairs is large, a faster and more compact way to save the pairings is required.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Temporarily Obscuring a Lottery Draw
by andreas1234567 (Vicar) on Nov 03, 2008 at 09:08 UTC |