I need to convert an Int32 to a code that has to be entered on a web form. To keep it simple for the visitors, this code needs to be as simple and short as possible.
Does anybody know a good algorithm for converting an Int32 to the shortest string representation possible using only [0-9] and [A-Z]?
You could encode to base-36, but for everyone’s sanity (not least your users, dealing with I vs 1, O vs 0 etc), I suggest just sticking to hex; plus it is built in: