PHP Classes

File: test.php

Recommend this page to a friend!
  Classes of Nanang F. Rozi   Base64 UUID Codec   test.php   Download  
File: test.php
Role: Auxiliary script
Content type: text/plain
Description: Configuration script
Class: Base64 UUID Codec
Encode and decode a UUID using base64 encoding
Author: By
Last change:
Date: 17 days ago
Size: 398 bytes
 

Contents

Class file image Download
<?php
include_once 'vendor/autoload.php';

use
FrosyaLabs\Utils\Codec\Base64Uuid\Base64UUIDCodec;

$uuid = '0ca50e59-bcf4-4627-9054-ab8e4917e71b';
echo
'Standard Base64 = '.base64_encode($uuid)."\n";
$shortBase64Uuid = Base64UUIDCodec::encode($uuid);
echo
'Shortened Base64 = '.$shortBase64Uuid."\n";
$reverted = Base64UUIDCodec::decode($shortBase64Uuid);
echo
$reverted."\n";

// Run: php test.php