PHP Classes

How Can PHP Convert UUDI to Binary Using Base64 Encoding Using the Package Base64 UUID Codec: Encode and decode a UUID using base64 encoding

Recommend this page to a friend!
  Info   Documentation   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2024-08-06 (1 month ago) RSS 2.0 feedNot yet rated by the usersTotal: 33 This week: 2All time: 11,049 This week: 22Up
Version License PHP version Categories
base64uuid-codec 1.0.0The PHP License7Algorithms, Text processing, PHP 7
Description 

Author

This package can encode and decode a UUID using base64 encoding.

It can decode a UUID string to extract the sequence of bytes of the UUID and encode it as a string using base64 encoding.

This package can also decode a UUID string encoded using base64 encoding to get the UUID value and return a string in the UUID format.

Innovation Award
PHP Programming Innovation award nominee
August 2024
Nominee
Vote
A UUID is an identifier that encodes a value used to represent an object uniquely.

The UUID string contains only ASCII characters to make it easier to transmit over channels that only allow readable text to be sent.

Encoding a UUID value as a string makes it longer in terms of the number of bytes than the original object identifier takes in binary format.

This package can decode a UUID string to get its binary value, thus taking fewer bytes to store.

Manuel Lemos
Picture of Nanang F. Rozi
  Performance   Level  
Name: Nanang F. Rozi <contact>
Classes: 3 packages by
Country: Indonesia Indonesia
Age: 36
All time rank: 440476 in Indonesia Indonesia
Week rank: 19 Up2 in Indonesia Indonesia Up
Innovation award
Innovation award
Nominee: 2x

Documentation

Base64UUIDCodec

Encode your UUID to a Base64-encoded string but in a shortened version.

Example

UUID = 0ca50e59-bcf4-4627-9054-ab8e4917e71b

Standard Base64-encoded string (48 char):


Shortened Base64-encoded string (22 char):  

Usage

$uuid = '0ca50e59-bcf4-4627-9054-ab8e4917e71b';

echo  FrosyaLabs\Utils\Codec\Base64Uuid\Base64UUIDCodec::encode($uuid);

Details

Base64UUIDCodec

Encode your UUID using Base64 but in a shortened version.

Example

UUID = 0ca50e59-bcf4-4627-9054-ab8e4917e71b

Standard Base64-encoded UUID (48 char):


Shortened Base64-encoded UUID (22 char):  

How to Use

$uuid = '0ca50e59-bcf4-4627-9054-ab8e4917e71b';

echo FrosyaLabs\Utils\Codec\Base64Uuid\Base64UUIDCodec::encode($uuid);

  Files folder image Files (8)  
File Role Description
Files folder imagesrc (3 files)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file composer.lock Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file README.md Doc. Documentation
Accessible without login Plain text file test.php Aux. Configuration script

  Files folder image Files (8)  /  src  
File Role Description
  Plain text file Base64URLSafeText.php Class Class source
  Plain text file Base64UUIDCodec.php Class Class source
  Accessible without login Plain text file README.md Doc. Documentation

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:33
This week:2
All time:11,049
This week:22Up