Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Replaces the BaseConverter class by the SequenceMapper #3
I needed to create a ShortURL application for Django and decided to not use "django-shorturls" because I have some different ideas for my project and would have to make lots of changes in the code of your application.
Based on that I started to look about some base converters algorithms to use but all of them are based in the mathematical chains of numbers and, becasue of that, excludes a lot of possible ShortURL codes. I decided to create my own "base converter", which I called "SequenceMapper" because it doesn't convert number between bases in fact, it just maps a number to its respective chain of chars. I created a gist in Github to try to explain what I'm talking about: https://gist.github.com/789720. This code is open source and my application is also hosted in Github: https://github.com/valvim/django-shortim.
So what my patch do is basically change the "BaseConverter" that is currently being used in the "django-shorturls" by the "SequenceMapper" that I'm using in my application. This application is already working in http://va.mu (Brazilian portuguese only, sorry).
Hope my code could be useful. :)