Jump to content

Encode Numbers for url use


pkedpker

Recommended Posts

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

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)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.