So I need to generate a code that can be tied to a specific user/prospect with a dollar amount built into it. It needs to be reversible so that client application can confirm the validity of the code and apply the discount a manager intends.
I'd like to make the code as short as possible but it needs to be well obfuscated so that the salesmen cannot start messing with it on their own.
I can come up with something myself bouncing numbers around, dividing by pi and converting to hex and whatnot but I'd be really interested in ideas or best practices from the community.
I'm doing this in C# but I expect that methods from any language can be translated.
edit: to clarify. I can't store this stuff ahead of time, the codes have to be built on the fly and carry all the information with them.
eg. Salesman 14 calls in about client 773 and wants to give them $500 off their order. 14, 773 and 500 must be in the coupon code and able to be extracted in the client app after the salesman keys in the code.