PHP code example of mindplay / keypack
1. Go to this page and download the library: Download mindplay/keypack 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/ */
mindplay / keypack example snippets
$packer = new UUIDPacker();
echo $packer->pack("7eb6de1e-65ef-4fb7-baff-c0732c1c4614"); // => "py6dWN6dgKR8cGVz73zDiT"
echo $packer->unpack("py6dWN6dgKR8cGVz73zDiT"); // => "7eb6de1e-65ef-4fb7-baff-c0732c1c4614"
$packer = new IntPacker('base64');
$packer->setRedundancy(4, 'super secret salt');
echo $packer->pack(123456); // => "7yg6HR"
echo $packer->unpack("7yg6HR"); // => (int) 123456