abublihi/guid-to-base64

Convert microsoft ldap objectGuid to Base64.

Installs: 2 585

Dependents: 0

Suggesters: 0

Security: 0

Stars: 3

Watchers: 1

Forks: 0

Open Issues: 0

Type:project

v2.0 2021-12-01 12:44 UTC

This package is auto-updated.

Last update: 2024-11-11 02:42:17 UTC


README

NOTE: For php <=7.1 see v1.0

ObjectGuid to base64 encode

This package only provides a function to encode an Object Guid to base64.

Problem

Microsoft azure immutable id is an encoding of the Object Guid to base64. but if you tray to encode the object guid directly it will preduse a not acceptable value or incorrect to the immutable id in microsoft azure. see example below

echo base64_encode("7ea2e22f-31cb-4c97-89eb-1b4501aafe40"); 
// output is "N2VhMmUyMmYtMzFjYi00Yzk3LTg5ZWItMWI0NTAxYWFmZTQw"

So this packge solves the problem.

Installation

composer require abublihi/guid-to-base64

Usage

use Abublihi\Guid\ToBase64;

$toBase64 = new ToBase64("7ea2e22f-31cb-4c97-89eb-1b4501aafe40");
echo $toBase64->getBase64(); // output "L+Kifssxl0yJ6xtFAar+QA=="
use Abublihi\Guid\ToBase64;

echo ToBase64::encode("748b2d72-706b-42f8-8b25-82fd8733860f"); // output "ci2LdGtw+EKLJYL9hzOGDw=="

Requirements

This package deeply depends on ramsey/uuid package.

References

Azure AD Connect: Design concepts

Credits