allty / base58
Base58 encoder/decoder written in PHP.
Installs: 4 032
Dependents: 0
Suggesters: 0
Security: 0
Stars: 9
Watchers: 3
Forks: 2
Open Issues: 1
Requires
- php: >=5.3
Requires (Dev)
- phpunit/phpunit: 3.7.*
This package is not auto-updated.
Last update: 2025-01-13 15:57:45 UTC
README
Using base-58 encoding for shortening URLs
This class can be used to convert integers (base 10) to base-58 strings. Base-58 contains alphanumeric characters minus "l" (letter l), "0" (number 0), and O (letter O) to prevent mistyping.
Install Base58 using composer
{
"require" : "allty/base58"
}
Usage
use Allty\Utils\Base58; // We will usually use something like a auto-incremented key from MySQL $url_id = 627868726; // encode() (shorten) $short = Base58::encode($url_id); // "XtZuS" // decode() $decoded = Base58::decode($short); // 627868726