Download the PHP package hamidgh83/url_shortner without Composer
On this page you can find all versions of the php package hamidgh83/url_shortner. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download hamidgh83/url_shortner
More information about hamidgh83/url_shortner
Files in hamidgh83/url_shortner
Download hamidgh83/url_shortner
More information about hamidgh83/url_shortner
Files in hamidgh83/url_shortner
Vendor hamidgh83
Package url_shortner
Short Description URL shortener Base-X encoder/decoder
License MIT
Package url_shortner
Short Description URL shortener Base-X encoder/decoder
License MIT
Please rate this library. Is it a good library?
Informations about the package url_shortner
The package
URL shortener Base-X encoder/decoder
This is a general purpose library to encode/decode an integer number. Given a string of valid alphabets you can encode your number into a small string.
A possible use case of this library is to use it as a url shortner. Just get the corresponding id of the url (from database) and encode it through this library. In this way you don't need to store the hash value in the DB and you will be able to change your encryption algorithm at any time.
Possible use cases
- Shorten URLs
- Two way comunication
- Hash generation
- ...
Examples
Example 1)
$num = 98201564;
$shotrner = new Shortner;
$encodedStr = $shotrner->encode($num);
echo $encodedStr;
$decodedStr = $shotrner->decode($encodedStr);
echo "\n" . $encodedStr;
Outputs:
gOcSm
98201564
Example 2)
$alphabets = "abcdefghijklmnopqrstuvwxyz";
$num = 98201564;
$shotrner = new Shortner($alphabets);
$encodedStr = $shotrner->encode($num);
echo $encodedStr;
$decodedStr = $shotrner->decode($encodedStr);
echo "\n" . $encodedStr;
Outputs:
igxgpg
98201564
All versions of url_shortner with dependencies
PHP Build Version
Package Version
Requires
php Version
>=5.6
The package hamidgh83/url_shortner contains the following files
Loading the files please wait ....