alt-three / uuid
A UUID To Integer Converter
Installs: 3 757
Dependents: 1
Suggesters: 1
Security: 0
Stars: 12
Watchers: 3
Forks: 1
Open Issues: 0
Requires
- php-64bit: ^7.1.3
Requires (Dev)
- graham-campbell/analyzer: ^2.0
- phpunit/phpunit: ^6.5|^7.0
This package is auto-updated.
Last update: 2022-02-01 13:12:47 UTC
README
A UUID to 64-bit signed integer converter.
UUIDs represent 128 bits of data, thus this is a lossy conversion, performed by xoring both halves of the UUID.
Installation
This version requires 64-bit PHP 7.1 or 7.2.
To get the latest version, simply require the project using Composer:
$ composer require alt-three/uuid
Usage
Say, you have a UUID to hand, and you'd like to convert it to an integer, then you're in luck!
AltThree\Uuid\UuidConverter::convert('2CD3F0DB-036E-41BA-84A6-72933F47F5FB'); // 4734454447164519848 AltThree\Uuid\UuidConverter::convert('{6167B53D-D8D2-42D3-8333-5BCA81A93A4C}'); // -6955673998131833630
It's easy as that! We are case insensitive, and support UUIDs with or without the surrounding braces.
Security
If you discover a security vulnerability within this package, please e-mail us at support@alt-three.com. All security vulnerabilities will be promptly addressed.
License
Alt Three Storage is licensed under The MIT License (MIT).