PHPackages                             cbschuld/php-uuid-base58 - 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. cbschuld/php-uuid-base58

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

cbschuld/php-uuid-base58
========================

Generates a RFC4122 compliant v4 UUID and returns it encoded in base-58. This is great for creating unique IDs which only consume 22 characters of storage. Also provides base-58 encoding and decoding.

1.0.1(6y ago)320.8k↓38.5%13MITPHPCI failing

Since Apr 11Pushed 6y ago1 watchersCompare

[ Source](https://github.com/cbschuld/php-uuid-base58)[ Packagist](https://packagist.org/packages/cbschuld/php-uuid-base58)[ RSS](/packages/cbschuld-php-uuid-base58/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (2)Versions (3)Used By (3)

php-uuid-base58
===============

[](#php-uuid-base58)

 [![](https://camo.githubusercontent.com/c888f82ffe36a54be9cd3f226299abdb85f3d5edc68f5af22597d674cf1315c1/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6362736368756c642f7068702d757569642d6261736535382f6d61737465723f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/c888f82ffe36a54be9cd3f226299abdb85f3d5edc68f5af22597d674cf1315c1/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6362736368756c642f7068702d757569642d6261736535382f6d61737465723f7374796c653d666c61742d737175617265) [![](https://camo.githubusercontent.com/5d7c14247d669aa150c0f930b60c8ca833863bb62b1f92cc593da456d151ae53/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6362736368756c642f7068702d757569642d6261736535383f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/5d7c14247d669aa150c0f930b60c8ca833863bb62b1f92cc593da456d151ae53/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6362736368756c642f7068702d757569642d6261736535383f7374796c653d666c61742d737175617265) [![](https://camo.githubusercontent.com/881c54c2d0762d04cb9992d95882d6aa41e749d1a36a63ba4773980753b87e15/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f6362736368756c642f7068702d757569642d6261736535383f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/881c54c2d0762d04cb9992d95882d6aa41e749d1a36a63ba4773980753b87e15/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f6362736368756c642f7068702d757569642d6261736535383f7374796c653d666c61742d737175617265)

Generates a RFC4122 compliant v4 UUID and returns it encoded in base-58. This is great for creating unique IDs which only consume 22 characters of storage. Also provides base-58 encoding and decoding.

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

[](#installation)

```
composer require cbschuld/php-uuid-base58
```

Usage
-----

[](#usage)

```
use cbschuld\UuidBase58;

$id = UuidBase58::id();
```

API
---

[](#api)

The UuidBase58 class provides three static functions

- `id` - creates the RFC4122 v4 UUID encoded in base-58
- `encode(string)` - encodes a base-16 string in base-58
- `decode(string)` - decodes a string from base-58 to base-16

Testing
-------

[](#testing)

```
npm run test
```

Performance Hit
---------------

[](#performance-hit)

There is an additional performance hit to translate a v4 UUID into base58. In testing I found the overhead for the translation to base58 adds an additional 31%. In 100k calculation batches I found that v4 uuid calculation took 1.606s/100k vs 2.319s/100k for uuid58. Thus, 69% of the runtime was consumed calculating a v4 uuid. Additional work could be done to bring the uuid calculation internal and attempt to increase performance.

Base58 Alphabet
---------------

[](#base58-alphabet)

This solution uses the Bitcoin / IPFS hash alphabet: 123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz

[Additional information on Base-58](https://en.wikipedia.org/wiki/Base58).

Contact
-------

[](#contact)

**Twitter** - @cbschuld

Contributing
------------

[](#contributing)

Yes, thank you! Please update the docs and tests and add your name to the package.json file.

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity31

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity57

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

Total

2

Last Release

2229d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/231867?v=4)[Chris Schuld](/maintainers/cbschuld)[@cbschuld](https://github.com/cbschuld)

---

Top Contributors

[![cbschuld](https://avatars.githubusercontent.com/u/231867?v=4)](https://github.com/cbschuld "cbschuld (6 commits)")

---

Tags

base58phpphp7uuiduuid-v4

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/cbschuld-php-uuid-base58/health.svg)

```
[![Health](https://phpackages.com/badges/cbschuld-php-uuid-base58/health.svg)](https://phpackages.com/packages/cbschuld-php-uuid-base58)
```

###  Alternatives

[grumpydictator/firefly-iii

Firefly III: a personal finances manager.

22.8k69.3k](/packages/grumpydictator-firefly-iii)[pocketmine/pocketmine-mp

A server software for Minecraft: Bedrock Edition written in PHP

3.5k74.6k86](/packages/pocketmine-pocketmine-mp)[shlinkio/shlink

A self-hosted and PHP-based URL shortener application with CLI and REST interfaces

4.8k4.3k](/packages/shlinkio-shlink)[getdkan/dkan

DKAN Open Data Catalog

385135.4k2](/packages/getdkan-dkan)[firefly-iii/data-importer

Firefly III Data Import Tool.

7545.8k](/packages/firefly-iii-data-importer)[tomaj/hermes

Simple php background processing library

38251.0k5](/packages/tomaj-hermes)

PHPackages © 2026

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