Reputation: 16242
I want to create coupon codes that users can remember easily. My idea is something like:
That is, a real word chosen randomly from a long dictionary list (preferably compiled for this purpose) combined 2 random digits. My questions are:
Fwiw I am not crazy about the Markov word generators because I think their idiosyncrasies would be too hard to remember. I'd like a client to be able to keep the code in his head, and tell it to the merchant when he arrives to redeem it.
Thanks, Jonah
Upvotes: 4
Views: 1088
Reputation: 15693
The Diceware page has a couple of long word lists, American and International. It also has a useful description of how to meet various levels of security.
Upvotes: 1
Reputation: 524
Concatenating 2 words will increase the security posture of your system. e.g. squirrel.nantucket.123
Upvotes: 1
Reputation: 78006
Word lists are easy to find. Make sure you sanity filter them for foul words ;)
Here's a huge word list that can be easily scrubbed:
http://www.scrabble-assoc.com/boards/dictionary/10-15-20030401.txt
From there you can easily load in words into your database and create your coupon code like so:
$coupon_code = $rand_word . rand(20,99);
After you do this, simply store your coupon code in the database and whenever you make a new code, check it against existing codes before you apply it. Even slim odds are possible odds.
More word lists in various formats:
http://scrabble.wonderhowto.com/blog/ultimate-scrabble-word-list-resource-0115617/
5-letter words: http://homepage.ntlworld.com/adam.bozon/Scrabble5.htm
6-letter words: http://homepage.ntlworld.com/adam.bozon/Scrabble6.htm
7-letter words: http://homepage.ntlworld.com/adam.bozon/Scrabble7.htm
8-letter words: http://homepage.ntlworld.com/adam.bozon/Scrabble8.htm
Sample:
PIKES PIKIS PILAF PILAR PILAU PILAW PILEA PILED PILEI PILES PILIS PILLS PILOT PILUS PIMAS PIMPS PINAS PINCH PINED PINES PINEY PINGO PINGS PINKO PINKS PINKY PINNA PINNY PINON PINOT PINTA PINTO PINTS PINUP PIONS PIOUS PIPAL PIPED PIPER PIPES PIPET PIPIT PIQUE PIRNS PIROG PISCO PISOS PISTE PITAS PITCH PITHS PITHY PITON PIVOT PIXEL PIXES PIXIE PIZZA PLACE PLACK PLAGE PLAID PLAIN PLAIT PLANE PLANK PLANS PLANT PLASH PLASM PLATE PLATS PLATY PLAYA PLAYS PLAZA PLEAD PLEAS PLEAT PLEBE PLEBS PLENA PLEWS PLICA PLIED PLIER PLIES PLINK PLODS PLONK PLOPS PLOTS PLOTZ PLOWS PLOYS PLUCK PLUGS PLUMB PLUME PLUMP PLUMS PLUMY PLUNK PLUSH PLYER POACH POCKS POCKY PODGY PODIA POEMS POESY POETS POGEY POILU POIND POINT POISE POKED POKER POKES
With that you could generate a coupon code POACH72
Upvotes: 3