PHPackages                             fatkulnurk/radix-converter - 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. fatkulnurk/radix-converter

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

fatkulnurk/radix-converter
==========================

A type-safe PHP library to convert numbers into short strings and back. Perfect for URL shorteners, unique IDs, and compact representations.

1.0.0(1mo ago)00MITPHPPHP &gt;=8.5CI passing

Since May 16Pushed 1mo agoCompare

[ Source](https://github.com/fatkulnurk/radix-converter-php)[ Packagist](https://packagist.org/packages/fatkulnurk/radix-converter)[ RSS](/packages/fatkulnurk-radix-converter/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

Radix Converter PHP
===================

[](#radix-converter-php)

A type-safe library to convert numbers into short strings and back. Perfect for URL shorteners, unique IDs, and compact representations.

[Packagist](https://packagist.org/packages/fatkulnurk/radix-converter)

---

Table of Contents
-----------------

[](#table-of-contents)

- [What Does This Do?](#what-does-this-do)
- [Requirements](#requirements)
- [Installation](#installation)
- [Quick Start](#quick-start)
- [Built-in Converters](#built-in-converters)
    - [Base62 Strategy](#1-base62-strategy-most-compact)
    - [Alphanumeric Upper Strategy](#2-alphanumeric-upper-strategy)
    - [Alphanumeric Lower Strategy](#3-alphanumeric-lower-strategy)
    - [Alpha Only Strategy](#4-alpha-only-strategy)
    - [Hex Strategy (Custom)](#5-hex-strategy-custom)
- [Common Use Cases](#common-use-cases)
    - [URL Shortener](#1-url-shortener)
    - [Different Converter Types](#2-different-converter-types)
    - [Error Handling](#3-error-handling)
- [Custom Converters](#custom-converters)
- [For Laravel Users](#for-laravel-users)
- [More Examples](#more-examples)
- [CI/CD](#cicd)
- [License](#license)

---

What Does This Do?
------------------

[](#what-does-this-do)

This library converts numbers like `12345` into short strings like `"3d7"` and back. This is useful for:

- Creating short URLs (like `bit.ly/3d7`)
- Generating compact unique IDs
- Making numbers easier to read and share

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

[](#installation)

Run this command in your terminal:

```
composer require fatkulnurk/radix-converter
```

Requirements
------------

[](#requirements)

- PHP 8.5 or higher

Quick Start
-----------

[](#quick-start)

Here's the simplest way to use it:

```
