1. Go to this page and download the library: Download semperton/multibase library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
semperton / multibase example snippets
use Semperton\Multibase\Base62;
use Semperton\Multibase\Base85;
// basic usage
$base62 = new Base62();
$base62->encode('Hello World'); // 73XpUgyMwkGr29M
$base62->decode('73XpUgyMwkGr29M'); // Hello World
// shorten md5 hash
$hash = md5('Hello World'); // b10a8db164e0754105b7a99be72e3fe5
$short = $base62->encode(hex2bin($hash)); // 5O4SoozqXEOwlYtvkC5zkr
$short = $base62->encode(md5('Hello World', true)); // same as above
$decoded = $base62->decode($short);
$hash === bin2hex($decoded); // true
// password generation
$bytes = openssl_random_pseudo_bytes(16);
$password = (new Base85())->encode($bytes); // e.g. Ncg>RWSYO+2t@~G8PO0J