I’d like to encode certain information, such as date and time of build and the SVN revision, into a reversible alphanumeric string so I can easily identify a build (besides maintaining a table of known builds).
I have no idea of how to go about this. Can you point me to related algorithms, commands, etc that will help me with this?
If you don’t need it to be too too short, use Base64 encoding.
Here I used an Epoch time since it’s fewer characters than a full date. Since it’s a number, and the SVN revision is a number too, you could also encode them using a different base. Using this Base 62 encoding function, you could reversibly encode the (date, revision) pair
1358883071-r3749as1tXJyT,YtBut Base64 is probably short enough, and it’s super easy.