A situation has arisen where I need to perform a base 36 to base 10 conversion, in the context of a SQL statement. There doesn't appear to be anything built into Oracle 9, or Oracle 10 to address this sort of thing. My Google-Fu, and AskTom suggest creating a pl/sql function to deal with the task. That is not an option for me at this...
I have learned how to Base16 encode a string in PHP, but how do I Base36 encode and decode a string in PHP?
Note I need this to make the string work in URLs.
BONUS: And if you know how to compress the string slightly first before doing the Base36, that would be even cooler! :)
...
Hi there,
I'm interested in creating tiny url like links. My idea was to simply store an incrementing identifier for every long url posted and then convert this id to it's base 36 variant, like the following in PHP:
$tinyurl = base_convert($id, 10, 36)
The problem here is that the result is guessable, while it has to be hard to guess...
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
Wh...