If I have a string FOOBAR-efkem4x-dnj3mn-efjn2j-lf4m2l (in this format) I need to convert into a shorter string consisting of just numerical values [0-9] so I can put it as a unique number in the URL for my Django project.
So that string should be converted into something like 324982984829 (can be higher or lower length, doesn't matter as long it is all numeric). Decoding 324982984829 should get me back to FOOBAR-efkem4x-dnj3mn-efjn2j-lf4m2l.
The end numerical value should be unique for every unique string.
Is there any way of doing this?
ordand add some 0's if needed for padding (if you are using only regular characters, 3 numerals per letter will be enough)