PHPackages                             mojahed/converts - 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. mojahed/converts

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

mojahed/converts
================

PHP wrapper for MdsConvert binary — digits, numbers, strings, dates, colors, units, encoding, hashing and more.

1.0.0(2w ago)03MITPHPPHP &gt;=7.4

Since May 21Pushed 2w agoCompare

[ Source](https://github.com/md-mojahed/mojahed-converts)[ Packagist](https://packagist.org/packages/mojahed/converts)[ RSS](/packages/mojahed-converts/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependenciesVersions (2)Used By (0)

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

[](#requirements)

- PHP &gt;= 7.4
- MdsConvert binary

Install
-------

[](#install)

```
composer require mojahed/converts
```

Usage
-----

[](#usage)

```
use Mojahed\Convert;

$c = Convert::setPath('/usr/local/bin/MdsConvert');

// Digit
$c->enToBn('12,345');          // ১২,৩৪৫
$c->bnToEn('১২,৩৪৫');         // 12,345

// Numbers
$c->stringToInt('12.99');      // 12
$c->stringToFloat('12.13');    // 12.13
$c->round('43.5435', 2);       // 43.54
$c->formatNum('1234567.8', 2); // 1,234,567.80
$c->abs('-9.5');               // 9.5

// Math
$c->percent('20', '500');      // 100.00
$c->percentOf('100', '500');   // 20.00%
$c->clamp('15', '0', '10');    // 10
$c->decToHex('255');           // ff
$c->hexToDec('ff');            // 255

// Strings
$c->slug('Hello World! 2024'); // hello-world-2024
$c->camelToSnake('myVar');     // my_var
$c->snakeToCamel('my_var');    // myVar
$c->truncate('Hello World', 5); // Hello...

// Date & Time (default = system timezone)
$c->humanToUnix('2024-05-18 05:20:00');  // 1716009600
$c->unixToHuman('1716009600');           // 2024-05-18 05:20:00 (+06)
$c->now();                               // current unix timestamp
$c->nowHuman();                          // current date/time

// Date with explicit timezone
$c->tz('Asia/Dhaka')->unixToHuman('1716009600');
$c->tz('America/New_York')->nowHuman();
$c->tz('Asia/Dhaka')->dateFormat('2024-05-18', 'DD/MM/YYYY TZ');

// Color
$c->hexToRgb('#ff6600');   // 255,102,0
$c->rgbToHex('255,102,0'); // #ff6600
$c->rgbToHsl('255,102,0'); // 24,100%,50%
$c->rgbToCss('255,102,0'); // rgb(255, 102, 0)

// Units
$c->cToF('100');           // 212.00
$c->kgToLb('70');          // 154.3234
$c->bytesTo('1048576', 'MB'); // 1.0000 MB

// Number to Words
$c->numToWords('100');           // one hundred
$c->numToWords('12345');         // twelve thousand three hundred forty-five
$c->numToWords('-999');          // negative nine hundred ninety-nine
$c->numToBnWords('১০০');         // একশত
$c->numToBnWords('১২৩৪৫');       // বারো হাজার তিনশত পঁয়তাল্লিশ
$c->numToBnWords('10000000');    // এক কোটি

// Encoding
$c->b64Encode('hello');    // aGVsbG8=
$c->b64Decode('aGVsbG8='); // hello
$c->sha256('hello');       // 2cf24dba...

// JSON
$c->jsonPretty('{"a":1}');
$c->jsonMinify('{ "a": 1 }');
$c->jsonValidate('{"ok":true}'); // valid

// UUID
$c->uuid();                // e.g. 806df7fe-c4e5-4f13-bb01-fc4ebda9ded2
$c->isUuid('550e8400-e29b-41d4-a716-446655440000'); // valid
```

Error Handling
--------------

[](#error-handling)

```
try {
    $result = Convert::setPath('/usr/local/bin/MdsConvert')->sha256('hello');
} catch (\RuntimeException $e) {
    echo $e->getMessage();
}
```

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance96

Actively maintained with recent releases

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity33

Early-stage or recently created project

 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

19d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/92214734?v=4)[Md Mojahedul Islam](/maintainers/md-mojahed)[@md-mojahed](https://github.com/md-mojahed)

---

Top Contributors

[![md-mojahed](https://avatars.githubusercontent.com/u/92214734?v=4)](https://github.com/md-mojahed "md-mojahed (2 commits)")

---

Tags

convertencodingcolorhashdateunitsBangladigits

### Embed Badge

![Health badge](/badges/mojahed-converts/health.svg)

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

###  Alternatives

[hashids/hashids

Generate short, unique, non-sequential ids (like YouTube and Bitly) from numbers

5.5k50.9M302](/packages/hashids-hashids)[paragonie/constant_time_encoding

Constant-time Implementations of RFC 4648 Encoding (Base-64, Base-32, Base-16)

904351.6M178](/packages/paragonie-constant-time-encoding)[gabrielelana/byte-units

Library to parse, format and convert byte units

1752.3M20](/packages/gabrielelana-byte-units)[spatie/color

A little library to handle color conversions

38120.5M33](/packages/spatie-color)[ssnepenthe/color-utils

A PHP library for performing SASS-like color manipulations.

631.2M13](/packages/ssnepenthe-color-utils)[delight-im/base-convert

Conversion of arbitrarily large numbers between any two bases or alphabets

171.2k](/packages/delight-im-base-convert)

PHPackages © 2026

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