PHPackages                             ofilin/base64uid - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. ofilin/base64uid

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

ofilin/base64uid
================

Class for generating UID

0.2(6y ago)151MITPHP

Since Jun 17Pushed 6y agoCompare

[ Source](https://github.com/ofilin/base64uid)[ Packagist](https://packagist.org/packages/ofilin/base64uid)[ RSS](/packages/ofilin-base64uid/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (2)DependenciesVersions (3)Used By (0)

Base64 UID
==========

[](#base64-uid)

Generate UID like YouTube.

Introduction
------------

[](#introduction)

The library generates a unique identifier consisting of 64 characters and a length of 10 characters *(you can change the length of the identifier).* This gives us a lot of combinations.

```
64^10 = 2^60 = 1 152 921 504 606 846 976 (combinations)

```

To represent this number, imagine that in order to get all possible values of identifiers with a length of **10**characters and generating an ID every microsecond, it takes **36 559** years.

[UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier) works on the same principle, but its main drawback is that it's too long. It is not convenient to use it as a public identifier, for example in the URL.

Due to the fact that **Base64 UID** uses 64 chars instead of 36, the identifier turns out to be noticeably shorter. Also you have the opportunity to manage the long identifier and the number of possible values. This will optimize the length of the identifier for your business requirements.

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

[](#installation)

Pretty simple with [Composer](http://packagist.org), run:

```
composer require ofilin/base64uid
```

Usage
-----

[](#usage)

```
use ofilin\base64uid\Base64UID;

$uid = Base64UID::generate(); // iKtwBpOH2E
```

With length 6 chars

```
// 64^6 = 68 719 476 736 (combinations)
$uid = Base64UID::generate(6); // nWzfgA
```

The floating-length identifier will give more unique identifiers.

```
// 64^10 + 64^9 + 64^8 = 1 171 217 378 093 039 616 (combinations)
$uid = Base64UID::generate(random_int(8, 10));
```

License
-------

[](#license)

This bundle is under the [MIT license](http://opensource.org/licenses/MIT). See the complete license in the file: LICENSE

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 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 ~10 days

Total

2

Last Release

2513d ago

### Community

Maintainers

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

---

Top Contributors

[![ofilin](https://avatars.githubusercontent.com/u/2737936?v=4)](https://github.com/ofilin "ofilin (3 commits)")

### Embed Badge

![Health badge](/badges/ofilin-base64uid/health.svg)

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

PHPackages © 2026

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