2017 © Pedro Peláez
 

library ulid

Universally Unique Lexicographically Sortable Identifier (ULID) implementation for PHP.

image

robinvdvleuten/ulid

Universally Unique Lexicographically Sortable Identifier (ULID) implementation for PHP.

  • Tuesday, February 27, 2018
  • by robinvdvleuten
  • Repository
  • 1 Watchers
  • 17 Stars
  • 6,194 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 4 Forks
  • 2 Open issues
  • 3 Versions
  • 91 % Grown

The README.md

Universally Unique Lexicographically Sortable Identifier

Latest Stable Version Build Status, (*1)

A PHP port of ulid/javascript with some minor improvements., (*2)

Sponsored by The Webstronauts , (*3)

Installation

You can install the package via Composer., (*4)

composer require robinvdvleuten/ulid

Usage

use Ulid\Ulid;

$ulid = Ulid::generate();
echo (string) $ulid; // 01B8KYR6G8BC61CE8R6K2T16HY

// Or if you prefer a lowercased output
$ulid = Ulid::generate(true);
echo (string) $ulid; // 01b8kyr6g8bc61ce8r6k2t16hy

// If you need the timestamp from an ULID instance
$ulid = Ulid::generate();
echo $ulid->toTimestamp(); // 1561622862

// You can also generate a ULID for a specific UNIX-time in milliseconds
$ulid = Ulid::fromTimestamp(1593048767015);
// or with a lower cased output: $ulid = Ulid::fromTimestamp(1593048767015, true);
echo (string) $ulid; // 01EBMHP6H7TT1Q4B7CA018K5MQ

Testing

bash composer test, (*5)

Changelog

Please see the GitHub "Releases" page for more information on what has changed recently., (*6)

Credits

As it's just a simple port of JavaScript to PHP code. All credits should go to the original ULID specs., (*7)

License

The MIT License (MIT). Please see License File for more information., (*8)

The Versions

27/02 2018

dev-master

9999999-dev https://github.com/robinvdvleuten/php-ulid

Universally Unique Lexicographically Sortable Identifier (ULID) implementation for PHP.

  Sources   Download

MIT

The Requires

 

The Development Requires

04/09 2017

v1.1.0

1.1.0.0 https://github.com/robinvdvleuten/php-ulid

Universally Unique Lexicographically Sortable Identifier (ULID) implementation for PHP.

  Sources   Download

MIT

The Requires

 

The Development Requires

17/06 2017

v1.0.0

1.0.0.0 https://github.com/robinvdvleuten/php-ulid

Universally Unique Lexicographically Sortable Identifier (ULID) implementation for PHP.

  Sources   Download

MIT

The Requires

 

The Development Requires