what I’m wanting is to convert an integer into a string. For example, 123456789 may become 8GFsah93r … you know like Youtube, Pastebin and what not. I then want to convert it back.
I’m working with large integers, for example: 131569877435989900
Take a look at this link: http://codepad.viper-7.com/wHKOMi
This is my attempt using a function I found on the web, obviously… it’s not correctly converting back to integer. I’m needing something that does this realiably.
Thanks
Ok, one of the ideas is to use a character array as a representation of a numeric system. Then you can convert from base 10 to base x and vica-versa. The value will be shorter and less readable (altought, you should encrypt it with a two-way crypter if it must be secure).
A solution:
Then you can use:
EDIT
with large numbers, it does not work. You should use this version (with bcmath http://www.php.net/manual/en/book.bc.php ) with very large numbers:
If something missing from here, please let me know, because it’s only a snippet from my library (I don’t wanna insert the whole thing here)
negra