pkedpker Posted June 16, 2009 Share Posted June 16, 2009 I want to be able to encode numbers in a type of BASE64 encoding but it's not as long.. To put it simply I want links like youtube gives out v=ds89f71 or something.. and it's not a hash like crc32 etc.. I want to be able to decode them when passed. many sites use it but i can't seem to figure it out.. hmm just came to mind it could just be rot13 but that doesn't work on numbers i'll try that but I still want responses if anyone got any. Link to comment https://forums.phpfreaks.com/topic/162441-encode-numbers-for-url-use/ Share on other sites More sharing options...
rhodesa Posted June 16, 2009 Share Posted June 16, 2009 All the do is generate a random string of characters and use a MySQL table to keep track of which key associates with which record Link to comment https://forums.phpfreaks.com/topic/162441-encode-numbers-for-url-use/#findComment-857442 Share on other sites More sharing options...
bibliovermis Posted June 16, 2009 Share Posted June 16, 2009 I want to be able to encode numbers in a type of BASE64 encoding You're wanting arbitrary number base conversion; in this case, base 10 <=> base 62. The source code for this functionality is available at: http://www.pgregg.com/projects/php/base_conversion/base_conversion.php ex: 1234567890987654321 (base 10) = 1TCKi2jjzdZ (base 62) Link to comment https://forums.phpfreaks.com/topic/162441-encode-numbers-for-url-use/#findComment-857491 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.