PHPackages                             rafalswierczek/numeral-system - 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. rafalswierczek/numeral-system

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

rafalswierczek/numeral-system
=============================

Simple numeral system conversion

1.0(3y ago)13[1 issues](https://github.com/rafalswierczek/numeral-system/issues)MITPHP

Since Sep 18Pushed 3y ago1 watchersCompare

[ Source](https://github.com/rafalswierczek/numeral-system)[ Packagist](https://packagist.org/packages/rafalswierczek/numeral-system)[ RSS](/packages/rafalswierczek-numeral-system/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

Simple numeral system conversion
================================

[](#simple-numeral-system-conversion)

### *Supported systems are binary, hexagonal and decimal.*

[](#supported-systems-are-binary-hexagonal-and-decimal)

Installation:
-------------

[](#installation)

> composer require rafalswierczek/numeral-system

### **Possible methods are:**

[](#possible-methods-are)

1. `toBin` - converts data to binary:

> ��

2. `toBinString` - converts data to binary string:

> 1010000011001111

3. `toHexString` - converts data to hexagonal string:

> A0CF

4. `toInt` - converts data to positive integer:

> 41167

### **Usage:**

[](#usage)

```
// in this example initial value is binary but it can be any of four above
$binary = random_bytes(4);

// all possible methods are used:
$hexStringBC = BinConverter::toHexString($binary);
$binaryStringHSC = HexStringConverter::toBinString($hexStringBC);
$hexStringBSC = BinStringConverter::toHexString($binaryStringHSC);
$intHSC = HexStringConverter::toInt($hexStringBSC);
$hexStringIC = IntConverter::toHexString($intHSC);
$binaryHSC = HexStringConverter::toBin($hexStringIC);
$binaryBSC = BinStringConverter::toBin($binaryStringHSC);
$binaryIC = IntConverter::toBin($intHSC);
$binaryStringIC = IntConverter::toBinString($intHSC);
$binaryStringBC = BinConverter::toBinString($binaryHSC);
$intBC = BinConverter::toInt($binaryIC);
$intBSC = BinStringConverter::toInt($binaryStringIC);

print_r(($binaryHSC === $binaryBSC && $binaryHSC === $binaryIC ? 'OK' : 'ERROR') . ' | binary: HSC === BSC === IC');
echo "\n";

print_r(($binaryStringBC === $binaryStringHSC && $binaryStringBC === $binaryStringIC ? 'OK' : 'ERROR') . ' | binary string: BC === HSC === IC');
echo "\n";

print_r(($hexStringBC === $hexStringBSC && $hexStringBC === $hexStringIC ? 'OK' : 'ERROR') . ' | hex string: BC === BSC === IC');
echo "\n";

print_r(($intBSC === $intHSC && $intBSC === $intBC ? 'OK' : 'ERROR') . ' | int: BSC === HSC === BC');
```

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity47

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

Unknown

Total

1

Last Release

1332d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/25b0d337f0f34a08f6adcf9603a9f4f942326d7794bdc9287a320a3284e10f10?d=identicon)[rafalswierczek](/maintainers/rafalswierczek)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/rafalswierczek-numeral-system/health.svg)

```
[![Health](https://phpackages.com/badges/rafalswierczek-numeral-system/health.svg)](https://phpackages.com/packages/rafalswierczek-numeral-system)
```

PHPackages © 2026

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