PHPackages                             sam-it/compress-numbers - 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. sam-it/compress-numbers

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

sam-it/compress-numbers
=======================

Specialized library to compress a list of nubers for use in REST URLs

v1.1.0(9y ago)022MITPHP

Since Jul 19Pushed 7y ago1 watchersCompare

[ Source](https://github.com/SAM-IT/compress-numbers)[ Packagist](https://packagist.org/packages/sam-it/compress-numbers)[ RSS](/packages/sam-it-compress-numbers/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (1)Versions (3)Used By (0)

compress-numbers
================

[](#compress-numbers)

Specialized library to compress a list of numbers for use in REST URLs

Use case
========

[](#use-case)

When having multiple IDs in URLs and alternatives like using `POST` are not preferable this library can help you by compressing arrays of numbers. The performance of compression depends on the types of numbers found in the array.

Algorithm.
----------

[](#algorithm)

- Sort the numbers
- Replace consecutive numbers by ranges (`[200, 201, 202, 205]` becomes `[[200, 202], [205]]`).
- For each range find a factor that is a multiple of 100.

The end result looks like this: `2X0T2N5`

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity64

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

Total

2

Last Release

3633d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/18b13c534e3812b66a72645fe215301b54fc4d288f6396fee9385b681e27da18?d=identicon)[SamMousa](/maintainers/SamMousa)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/sam-it-compress-numbers/health.svg)

```
[![Health](https://phpackages.com/badges/sam-it-compress-numbers/health.svg)](https://phpackages.com/packages/sam-it-compress-numbers)
```

###  Alternatives

[bensampo/laravel-embed

Painless responsive embeds for videos, slideshows and more.

143165.6k](/packages/bensampo-laravel-embed)[portphp/steps

Step aggregator for Port

241.4M2](/packages/portphp-steps)

PHPackages © 2026

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