PHPackages                             doughmii/dev-utils - 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. doughmii/dev-utils

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

doughmii/dev-utils
==================

A collection of small and useful PHP utilities for daily development

v1.0.2(11mo ago)18MITPHP

Since May 27Pushed 11mo agoCompare

[ Source](https://github.com/DoughMii/dev-utils)[ Packagist](https://packagist.org/packages/doughmii/dev-utils)[ RSS](/packages/doughmii-dev-utils/feed)WikiDiscussions main Synced 1mo ago

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

dev-utils
=========

[](#dev-utils)

> English | [简体中文](README.zh-CN.md)

A lightweight PHP utility toolkit for daily development. Modular design — currently includes a **Base62 encoder** and a **human-friendly time formatter**, and more tools can be added over time.

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

[](#installation)

Install via Composer：

```
composer require doughmii/dev-utils
```

Usage
-----

[](#usage)

### 🔢 Base62Encoder

[](#-base62encoder)

A simple Base62 encoder/decoder that supports optional salt and batch encoding.

```
use DoughMii\DevUtils\Id\Base62Encoder;

$encoder = new Base62Encoder();

// Encode and decode a single integer
$encoded = $encoder->encode(123456);
$decoded = $encoder->decode($encoded);

// Encode and decode with salt
$encodedSalted = $encoder->encode(123456, 'my-salt');
$decodedSalted = $encoder->decode($encodedSalted, 'my-salt');

// Encode and decode multiple integers
$data = [1, 2, 3];
$encodedMultiple = $encoder->encodeMultiple($data, 'salt123');
$decodedMultiple = $encoder->decodeMultiple($encodedMultiple, count($data), 'salt123');
```

### 🕒 TimeHumanizer

[](#-timehumanizer)

Converts time differences into human-friendly text, supporting multiple languages (English, Chinese) and precise month/year logic.

```
use DoughMii\DevUtils\Time\TimeHumanizer;

$now = new DateTimeImmutable();
$past = $now->modify('-3 days');

echo TimeHumanizer::diffForHumans($past); // e.g. "3 days ago"
echo TimeHumanizer::fromNow($past);       // same as above

// With custom locale (zh)
echo TimeHumanizer::diffForHumans($past, null, 'zh'); // "3 天前"
```

测试
--

[](#测试)

运行 PHPUnit 测试：

```
vendor/bin/phpunit
```

许可证
---

[](#许可证)

MIT

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance50

Moderate activity, may be stable

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity39

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

Every ~0 days

Total

3

Last Release

356d ago

### Community

Maintainers

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

---

Top Contributors

[![DoughMii](https://avatars.githubusercontent.com/u/212823262?v=4)](https://github.com/DoughMii "DoughMii (9 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/doughmii-dev-utils/health.svg)

```
[![Health](https://phpackages.com/badges/doughmii-dev-utils/health.svg)](https://phpackages.com/packages/doughmii-dev-utils)
```

###  Alternatives

[yii2mod/yii2-chosen-select

Chosen Select Widget based on Chosen jQuery plugin

14113.9k](/packages/yii2mod-yii2-chosen-select)[defstudio/filament-searchable-input

A searchable autocomplete input for Filament forms

3212.4k](/packages/defstudio-filament-searchable-input)[flynsarmy/oc-idehelper-plugin

OctoberCMS plugin to make development easier by providing IDE helpers

238.3k](/packages/flynsarmy-oc-idehelper-plugin)

PHPackages © 2026

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