PHPackages                             choval/lid - 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. [Database &amp; ORM](/categories/database)
4. /
5. choval/lid

ActiveLibrary[Database &amp; ORM](/categories/database)

choval/lid
==========

A long 64-bit number used to identify rows in a database

v1.0.2(5y ago)074MITPHPCI failing

Since Aug 4Pushed 5y ago1 watchersCompare

[ Source](https://github.com/choval/lid)[ Packagist](https://packagist.org/packages/choval/lid)[ RSS](/packages/choval-lid/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (7)Dependencies (3)Versions (8)Used By (0)

LID
===

[](#lid)

LID (LongID) is a 64-bit number used to identify rows in a database.
Made specifically for use with BIGINT/LONGINT in databases. Includes a checksum to verify data.

Note: v1.x is not compatible with v0.x.

Install
-------

[](#install)

```
composer require choval/lid^1.0
```

Format
------

[](#format)

It is built using a base 62:

```
0123456789
abcdefghijklmnopqrstuvwxyz
ABCDEFGHIJKLMNOPQRSTUVWXYZ

```

- Except the web format, see [Web](#web).

The checksum (Damm) is the first character.

### Examples

[](#examples)

```
NUM: 9223372036854775807
WEB: 75FE_KXVC_3KP2_6XC7
LID: 7aZl-8N0y-58M7

NUM: 8057322199735401981
WEB: 94V7_27P8_8CP6_54X1
LID: 99Bc-CvJ3-BrCR

NUM: 495653535173419733
WEB: 961_3H6_471H_P96H
LID: 9AC-66ri-lnk9

NUM: 3412381023195
WEB: 0_6H_5V91_7PXK
LID: 0-Y4L-x15V

NUM: 8954382094
WEB: 2_6XV4_PK4J
LID: 2-9L-ZFPE

NUM: 21398
WEB: 1_2H9V
LID: 1-5z8

NUM: 1024
WEB: 4_2E4
LID: 4-gw

```

Web
---

[](#web)

A different base is used for the web format.

Altough longer in length due to a shorter base, it is easier for dictation (across dialects) and more error friendly for OCR engines.

Alias characters are replaced.

```
0 - zero - alias: OoDQ
1 - one - alias: IiLl
2 - two - alias: Zz
3 - three
4 - four - alias: AYy
5 - five - alias: Ss
6 - six - alias: Gb
7 - seven - alias: T
8 - eight - alias: BRg
9 - nine - alias: q
C - charlie - alias c
E - echo - alias e
F - foxtrot - alias f
H - hotel - alias h
J - juliett - alias j
K - kilo - alias k
N - november - alias: Mmn
P - tango - alias: p
V - victor - alias: UuWw
X - xray - alias x

```

Usage
-----

[](#usage)

```
/**
 * Basic usage
 */
$lid = new Lid( 21398 );
echo $lid->id();
// 1-5z8
echo $lid->web();
// 1_2H9V
echo $lid->number();
// 21398

/**
 * The constructor accepts an int, a LID or a Web LID
 */
$lid = new Lid( '1_2H9V' );
echo $lid->id();
// 1-5z8
echo $lid->web();
// 1_2H9V
echo $lid->number();
// 21398

/**
 * The constructor accepts long formats as well
 */
$lid = new Lid( '1000_0000_0000_2H9V' );
echo $lid->id();
// 1-5z8
echo $lid->web();
// 1_2H9V
echo $lid->number();
// 21398

/**
 * And the web format allows you to make mistakes with letters and nums
 */
$lid = new Lid( '1_zHqU' );
echo $lid->id();
// 1-5z8
echo $lid->web();
// 1_2H9V
echo $lid->number();
// 21398
```

License
-------

[](#license)

MIT, see LICENSE

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~63 days

Recently: every ~92 days

Total

7

Last Release

2096d ago

Major Versions

v0.2.1 → v1.0.02020-03-13

### Community

Maintainers

![](https://www.gravatar.com/avatar/f7e751254e7e7b319464bd6b51c51d9d2c5fedb4c2305ceaa580f9116cbc6a11?d=identicon)[choval](/maintainers/choval)

---

Top Contributors

[![choval](https://avatars.githubusercontent.com/u/794926?v=4)](https://github.com/choval "choval (7 commits)")

---

Tags

bigintcheckdigitdatabase-idsformatidlongintphp

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/choval-lid/health.svg)

```
[![Health](https://phpackages.com/badges/choval-lid/health.svg)](https://phpackages.com/packages/choval-lid)
```

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k115.1M102](/packages/jdorn-sql-formatter)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.4k](/packages/illuminate-database)[mongodb/mongodb

MongoDB driver library

1.6k64.0M546](/packages/mongodb-mongodb)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

90340.3M211](/packages/ramsey-uuid-doctrine)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
