• Stars
    star
    441
  • Rank 98,861 (Top 2 %)
  • Language
    PHP
  • License
    MIT License
  • Created almost 8 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A PHP port of alizain/ulid with some minor improvements.

Universally Unique Lexicographically Sortable Identifier

Latest Stable Version Build Status

A PHP port of ulid/javascript with some minor improvements.

Sponsored by The Webstronauts

Installation

You can install the package via Composer.

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

composer test

Changelog

Please see the GitHub "Releases" page for more information on what has changed recently.

Credits

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

License

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

More Repositories

1

vuex-persistedstate

💾 Persist and rehydrate your Vuex state between page reloads.
JavaScript
5,763
star
2

shvl

🚧 Get and set dot-notated properties within an object.
JavaScript
73
star
3

php-nntp

Client for communicating with servers throught the Network News Transfer Protocol (NNTP) protocol.
PHP
38
star
4

gingerbread

📝 A wrapper around Ginger proofreader for correcting spelling and grammar mistakes based on the context of complete sentences.
JavaScript
34
star
5

preact-cli-plugin-env-vars

🛠 Consume variables in your environment with the Preact CLI.
JavaScript
34
star
6

chronicle

Tiny observable & high-performance state management.
JavaScript
21
star
7

vue-auth0-vuex

Simple authentication flow setup in Vue with Auth0 and Vuex.
JavaScript
13
star
8

node-nntp

Client for communicating with servers throught the Network News Transfer Protocol (NNTP) protocol.
JavaScript
10
star
9

preact-cli-plugin-graphql

🛠 Preprocess GraphQL queries with the Preact CLI.
JavaScript
9
star
10

guzzle-clients

Contains the configuration for multiple APIs in Guzzle.
PHP
6
star
11

hapi-ember-fastboot

Ember Fastboot handler for hapi.js.
JavaScript
4
star
12

react-todo-workshop

⛱ Sandbox project for one of my React workshops
HTML
3
star
13

gigya-toolkit

📦 A CLI toolkit to create your Gigya screensets with React.
JavaScript
3
star
14

preact-cli-plugin-styled-components

💅 Adds the styled-components Babel plugin to Preact CLI.
JavaScript
3
star
15

observable-fetch

🔋 RxJS Observable wrapped around the WHATWG Fetch API.
JavaScript
3
star
16

addressing

Addressing library powered by CLDR and Google's address data
Ruby
3
star
17

guzzle-ews

EWS Exchange client based on Guzzle
PHP
3
star
18

beancount

Go
2
star
19

dotfiles

⚙️ Public repo for my personal dotfiles
Shell
2
star
20

json-from-script

👮🏻 Tiny JSON parser for your CSP aware script tags.
JavaScript
2
star
21

react-auth0-redux

Simple authentication flow setup in React with Auth0 and Redux.
JavaScript
2
star
22

php-lazy-event-dispatcher

😴 An event dispatcher that holds any events until flushed.
PHP
1
star
23

postcss-camelize

PostCSS plugin for camelizing strings.
JavaScript
1
star
24

hippalus

⚓️ [WIP] Tiny router to navigate through browser apps.
JavaScript
1
star
25

react-whatever

🤷‍♂️ Higher-order component to render whatever it gets passed.
JavaScript
1
star
26

redirect-now

Middleware to redirect aliased Now deployments.
JavaScript
1
star
27

react-rxjs-workshop

🏝 Sandbox project for one of my React workshops
JavaScript
1
star
28

hhmm

Convert a digit time string to milliseconds: '22:17' → 80220000
JavaScript
1
star
29

ns-journey-planner

JavaScript
1
star
30

dsmr

A parser for DSMR telegram data in Go
Go
1
star
31

react-nntp

Network News Transfer Protocol (NNTP) bindings for React.
PHP
1
star