I'm using mysql database auto-increment as an order ID. When I display the order ID to the user, I want to somehow mask/obfuscate it.
Why?
- So at first glance, it is obvious to admin users what the number refers to (orders start with 10, customers start with 20 etc)
- To hide, at first glance, that this is only my 4th order.
Based on this this answer, I want the masked/obfuscated order id to:
- Be only numbers
- Consistent length (if possible)
- Not cause collisions
- Be reversible so I can decode it and get the original ID
How would I acheive this in PHP? It doesn't have to be very complex, just so at first glance it's not obvious.