I have a 13 digit number (or more) and I want to shortener it as much as I can with PHP.
I don’t want to trim/cut/round it. I want to encode/decode it. Is not important the security of the encoded data.
To explain better, I found 2 service online:
service 1: https://www.prepostseo.com/tool/decimal-to-ascii
number: 9788868902377
base64 encode result: w60H
service 2: https://v2.cryptii.com/decimal/base64
number: 9788868902377 (same as above)
base64 encode result: 67ep
base64_encode() function in php:
number: 9788868902377 (same as above)
base64 encode result: OTc4ODg2ODkwMjM3Nw==
I didn’t understand… same encoding (base64), 3 different output.
The first and second service is good (very small lenght and loseless decoding) but I need something like these in PHP. The actual base64_encode() give me a result too long.
I searching some solutions in google and stackoverflow as well. Every solutions I found it’s about trimming/rounding/cutting the number. I don’t need this, I need to shortening (encoding) and later recovery (decoding) the original number in PHP.
Any help is appreciated.