Generate somewhat random, but unique codes?
The subject header says most of it. Anyone have a good way to do this? I need to generate codes that individuals can use to login and download promotional material, and these codes need to be unique from each other. I'm thinking ~8 characters, numbers and letters. The scripting that uses these codes is case sensitive, so variability in upper and lower case would be nice to have as well.
I'd like to create codes that aren't linearly related, or at least not related in obvious (easily guessable) ways. My math skills aren't too hot. Maybe a function that bases the output off of a sequentially increasing number global field?