I am building a small rails app and I need a way to generate tracking numbers to give to customers to check up on their status. I want something similar to what the major shipping companies use, but not as long. Im thinking 12-16 characters long is fine, but I dont want something like 0000000001 where people can just type in incremented numbers and peep around.
What is a good way to generate unique number/letter combination tracking codes?
For meaningless data, hashes of the time plus a salt are always rock solid, and can’t be guessed easily (forgive the Python, I’ve heard of this Ruby thing but never held it in my hands):
Shorten it, if you like:
Use an integer instead, if you like, but the length has the chance to vary with this code, unless you zero-pad:
In before “zomg md5 isn’t crypto secure”:
Hell, you don’t even have to use time, you can use an autoincrementing integer, as long as you salt it:
Hashes. Is there anything they can’t do?