Very late reply. Did not see your question for some reason. The database of qCodes for postal addresses will be free to use, much the way the database of post codes is free to use. There is no algorithm, the system is database driven.
To keep the length of the code as short as possible, I divide the world up into Groups, North American and Europe being two examples. Dallas and Darmstadt are in different Groups, Thus BOTH could have qCodes beginning with DA. The Groups are sub-divided into what I call Regions. Each of these Regions has a max POPULATION of about 20 million (when using a 7 character code). Regions are designed to be metropolitian areas. If 2 metro areas (in same Group) would have a preferred code, say Dallas and Dayton, the metro areas with largest population gets "first choice." Thus Dallas gets DA- and Dayton would get, for example: DY- . Nothing magic about it. Purely a "management" decision.