PHPackages                             soleimanpour/toolkit - 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. soleimanpour/toolkit

ActiveLibrary

soleimanpour/toolkit
====================

Custom Package

v1.0.1(11mo ago)010MITPHPPHP &gt;=8.2

Since Sep 7Pushed 11mo ago1 watchersCompare

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

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

**Version:** v1.0.1

Soleimanpour/Toolkit
====================

[](#soleimanpourtoolkit)

This package provides utility functions for generating short URLs and converting numbers to different bases (up to base 62). It is particularly useful for URL shortening and ID generation.

Features
--------

[](#features)

- **generate\_short\_url($input)**: This function generates a short unique string based on the input.
- **to\_base($number, $base)**: This function converts a given number to a specified base, with support for up to base 62.
- **custom\_string\_to\_int(string $input)**: Converts a string to a numeric hash while preserving the order of characters. Uses a rolling hash algorithm with modulus to prevent overflows.

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

[](#installation)

You can install the package via Composer:

```
composer require soleimanpour/toolkit
```

### Usage

[](#usage)

Example 1: Generating a short URL
---------------------------------

[](#example-1-generating-a-short-url)

```
echo generate_short_url('abc');  // Example output: p46

echo generate_short_url('cba');  // Example output: pz4

echo generate_short_url('aaaaaaaaaa');  // Example output: tXt6X
```

Example 2: Converting a number to base 62
-----------------------------------------

[](#example-2-converting-a-number-to-base-62)

```
echo to_base(123456, 62);  // Example output: w7e
```

Example 3: Converting a string to an integer hash
-------------------------------------------------

[](#example-3-converting-a-string-to-an-integer-hash)

```
echo custom_string_to_int('abc');        // Example output: 96354

echo custom_string_to_int('cba');        // Example output: 98274

echo custom_string_to_int('aaaaaaaaaa'); // Example output: 442687003
```

### License

[](#license)

This package is open-source software licensed under the MIT license.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance51

Moderate activity, may be stable

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

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

Total

2

Last Release

346d ago

### Community

Maintainers

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

---

Top Contributors

[![soleimanpour](https://avatars.githubusercontent.com/u/130162910?v=4)](https://github.com/soleimanpour "soleimanpour (8 commits)")

### Embed Badge

![Health badge](/badges/soleimanpour-toolkit/health.svg)

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

PHPackages © 2026

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