PHP code example of eislambey / splathash-php
1. Go to this page and download the library: Download eislambey/splathash-php 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/ */
eislambey / splathash-php example snippets
use Islambey\SplathashPhp\SplatHash;
// 16 raw bytes
$string = SplatHash::toBase64Url($hash); // 22-char base64url string
$sameHash = SplatHash::fromBase64Url($string);
$rgba = SplatHash::decode($sameHash); // 32 * 32 * 4 raw RGBA bytes
$hash = SplatHash::encodeRaw($rgbaBytes, $width, $height);
bash
composer bash
composer install
php tests/run.php