Another hastily named Python script from yamatt.
This module is designed to help developers who are looking to implement URL shorteners based upon an incrementing number.
Have a look at the unittest for more examples, but source code example is below:
from dencoder import Dencoder d = Dencoder() print d.encode(234) print d.decode("xyz")
This can then be used to translate a number to a shorter ASCII encoding of the number which can then used as a unique ID.
Ported the from here: https://gist.github.com/1308732/4f6ef4f47e85e1da5d3814c632f195d173dad829