charlydagos / optimized-uuid
Uuids for optimized storage
dev-master
2016-08-10 09:11 UTC
Requires
- php: >=5.4
- ramsey/uuid: ^3.5
Requires (Dev)
- phpunit/phpunit: ^5.4
This package is not auto-updated.
Last update: 2025-01-04 21:03:21 UTC
README
Small and simple package implementing an efficient way of storing UUIDs in a MySQL (InnoDB) database.
Credit for the actual research goes to Karthik Appigatla, and his blog post for Percona
https://www.percona.com/blog/2014/12/19/store-uuid-optimized-way/
This is available for download through packagist here
https://packagist.org/packages/charlydagos/optimized-uuid
Usage
This library depends on ramsey/uuid
.
To use it you could do
<?php use Charlydagos\OptimizedUuid\OptimizedUuid; $uuid = ...; // exisitng uuid string $optimizedUuid = OptimizedUuid::toOrderedUuid($uuid);
Or create an object with an exisitng Uuid
object
<?php use Ramsey\Uuid\Uuid; use Charlydagos\OptimizedUuid\OptimizedUuid; $uuid = Uuid::uuid1(); $optimizedUuid = new OptimizedUuid($uuid);
License
Please see the LICENSE file in this repo.