I have a list of folders that are organised by base36 (0-9 then a-z). Now my current implementation for reading them is to iterate over a number, convert it to base32, check if the folder exists. If it does read the data if it doesn't end.
The problem here is that there are gaps in the folder's numbers. Ex: 0,1,2,4,5,6,8,a,b,c,g,k,p
What would be the best way of iterating over them all, in the correct order (considering there can be any amount of folders)?
(Note: I can't simply get all of the directories, because they'd be ordered alphabetically. 2A for example would be placed before z)