A requirement that came up for the web project I’m working on was a way to have users get a unique code that can be redeemed on the site. I was told that on a previous project they used a single code for each redeemable item, which did not work well at all. I came up with, what I think is, a pretty elegant solution.