PHPackages                             service-to/base - 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. service-to/base

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

service-to/base
===============

Library to convert integers to base62 strings, useful for shortURLs based on ID numbers in a database.

1.1.1(10y ago)0158MITPHPPHP &gt;=5.3.0

Since Sep 30Pushed 10y ago1 watchersCompare

[ Source](https://github.com/ServiceTo/Base)[ Packagist](https://packagist.org/packages/service-to/base)[ Docs](https://github.com/ServiceTo/Base)[ RSS](/packages/service-to-base/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (4)Used By (0)

Base
====

[](#base)

Library to convert integers to base62 strings, useful for shortURLs based on ID numbers in a database.

Usage
-----

[](#usage)

### Install using composer...

[](#install-using-composer)

```
composer require "service-to/base"

```

### In a Laravel Controller

[](#in-a-laravel-controller)

```
Route::get('{shortcode}', function ($shortcode) {
	$base = new ServiceTo\Base();
	return View::make("content")->withArticle(App\Article::find($base->base2int($shortcode)));
});

```

### In plain old PHP

[](#in-plain-old-php)

```
require_once("vendor/autoload.php");
use ServiceTo\Base;

function shorturl($url) {
	$myshortdomain = "http://short.long.urls.3.14159.xyz/";

	$base = new Base();
	$stmt = $pdo->prepare("INSERT INTO shorturls SET url=?");
	$stmt->bindValue(1, $url, PDO::PARAM_STR);
	$stmt->execute();

	return($myshortdomain . $base->int2base($stmt->lastInsertId()));
}

```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity60

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

Total

3

Last Release

3756d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6bf01d00c88c951fe9260577dcbb8d231138c16faf60d0c3d0d2b711ebc730e2?d=identicon)[ServiceTo](/maintainers/ServiceTo)

---

Top Contributors

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

---

Tags

base62

### Embed Badge

![Health badge](/badges/service-to-base/health.svg)

```
[![Health](https://phpackages.com/badges/service-to-base/health.svg)](https://phpackages.com/packages/service-to-base)
```

###  Alternatives

[tuupola/base62

Base62 encoder and decoder for arbitrary data

1994.3M35](/packages/tuupola-base62)[elfsundae/laravel-hashid

A simple, elegant way to obfuscate your data by generating reversible, non-sequential, URL-safe identifiers.

415246.3k2](/packages/elfsundae-laravel-hashid)[tuupola/ksuid

K-Sortable Globally Unique IDs

1081.2M4](/packages/tuupola-ksuid)[xobotyi/basen

Text and integers encoding utilities for PHP with no extensions dependencies. Base32, Base58, Base64 and much more!

1219.6k](/packages/xobotyi-basen)[base62/base62

base62 encoder and decoder also for big numbers with Laravel integration

169.5k](/packages/base62-base62)

PHPackages © 2026

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