PHPackages                             tiny-blocks/ksuid - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [PSR &amp; Standards](/categories/psr-standards)
4. /
5. tiny-blocks/ksuid

ActiveLibrary[PSR &amp; Standards](/categories/psr-standards)

tiny-blocks/ksuid
=================

K-Sortable Unique Identifier.

2.0.1(6d ago)688.8k↓59.4%11MITPHPPHP ^8.5CI passing

Since Jun 8Pushed 6d ago1 watchersCompare

[ Source](https://github.com/tiny-blocks/ksuid)[ Packagist](https://packagist.org/packages/tiny-blocks/ksuid)[ Docs](https://github.com/tiny-blocks/ksuid)[ RSS](/packages/tiny-blocks-ksuid/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (10)Dependencies (17)Versions (14)Used By (1)

Ksuid
=====

[](#ksuid)

[![License](https://camo.githubusercontent.com/f8df3091bbe1149f398a5369b2c39e896766f9f6efba3477c63e9b4aa940ef14/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e)](https://github.com/tiny-blocks/ksuid/blob/main/LICENSE)

- [Overview](#overview)
- [Installation](#installation)
- [How to use](#how-to-use)
- [License](#license)
- [Contributing](#contributing)

Overview
--------

[](#overview)

Ksuid stands for [K-Sortable Unique Identifier](https://segment.com/blog/a-brief-history-of-the-uuid). It's a way to generate globally unique IDs which are partially chronologically sortable.

Installation
------------

[](#installation)

```
composer require tiny-blocks/ksuid
```

How to use
----------

[](#how-to-use)

The library exposes a concrete implementation through the `Ksuid` class.

### Creating a Ksuid

[](#creating-a-ksuid)

With the `random` method, a new instance of type `Ksuid` is created from a timestamp (*current unix timestamp - EPOCH*) and a payload (*cryptographically secure pseudo-random bytes*).

```
