Need pointer for algorithm on generating alphanumeric sequence. The requirement is as follows.
Only 0-9, A-Z and a-z characters can be used. Initially the sequence will start with only one character and when the sequence has been exhausted will it go to two characters and similarly the sequence will be incremented when the previous sequence has been exhausted.
Example of the sequences are given below
One Character sequence
0 1 2 .. 9 A B .. Z a b .. z
Now the one character sequence has been exhausted. Then a 2 digit series will start.
00 01 02 .. 09 0A 0B .. 0Z 0a 0b .. 0z 10 11 .. 19 1A .. 1Z 1a 1b .. zz
After two characters series has been exhausted then 3 character series will start as given below
000 ... zzz
And the series will generate till the 12 character series has been exhausted.
Can anybody help me point to some link or suggest me the mechanism to do it?
I am trying to do this in PHP.
Thanks
See Question&Answers more detail:os