I was playing around with numbering systems as I wanted some numbers to be represented by letters (or what you'd call Base 26).
A=0, B=1, C=2 etc..
When it gets to 26 it becomes BA, not AA as you might think to begin with. Think of it like the number 10. AA would equal zero just like 00.
I wrote this in plain JavaScript for easy testing, and it should be fairly straight-forward to port this to other languages if needed.
Usage