I\'m generating a 6 digit code from the following characters. These will be used to stamp on stickers. They will be generated in batches of 10k or less (before printing)
I had the same problem, and I found very impressive open source solution:
http://www.hashids.org/php/
You can take and use it, also it's worth it to look in it's source code to understand what's happening under the hood.