PHPackages                             ttx/random-four-code - 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. ttx/random-four-code

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

ttx/random-four-code
====================

A lightweight PHP 8.2 package for generating random 4-digit codes

v1.0.0(5mo ago)01MITPHPPHP ^8.2

Since Dec 9Pushed 5mo agoCompare

[ Source](https://github.com/1509239073/random-four-code)[ Packagist](https://packagist.org/packages/ttx/random-four-code)[ Docs](https://github.com/1509239073/random-four-code)[ RSS](/packages/ttx-random-four-code/feed)WikiDiscussions main Synced 1mo ago

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

Random Four Code Generator
==========================

[](#random-four-code-generator)

一个简单易用的 PHP 8.2 随机4位编码生成器。

特性
--

[](#特性)

- 🎲 生成4位随机编码
- 🎯 支持多种编码类型（数字、字母、混合等）
- 🔒 基于 `random_int()` 的安全随机生成
- 📦 简单易用的 API
- 🧪 完整的测试覆盖
- 🚀 PHP 8.2 优化

安装11
----

[](#安装11)

```
composer require ttx/random-four-code
```

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance72

Regular maintenance activity

Popularity1

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

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

160d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6f1c6550fcaec373de5e3cdfc132fb62f9e2e7466c4c15d7d1a8b082412860cb?d=identicon)[1509239073](/maintainers/1509239073)

---

Tags

randomcodegeneratorphp824-digit

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ttx-random-four-code/health.svg)

```
[![Health](https://phpackages.com/badges/ttx-random-four-code/health.svg)](https://phpackages.com/packages/ttx-random-four-code)
```

###  Alternatives

[mistic100/randomcolor

Generate attractive random colors

2431.4M6](/packages/mistic100-randomcolor)[ihor/nspl

Non-standard PHP library (NSPL) - functional primitives toolbox and more

381368.5k](/packages/ihor-nspl)[riimu/kit-phpencoder

Highly customizable alternative to var\_export for PHP code generation

717.8M32](/packages/riimu-kit-phpencoder)[nubs/random-name-generator

A library to create interesting, sometimes entertaining, random names.

135680.2k3](/packages/nubs-random-name-generator)[gladcodes/keygen

A fluent PHP random key generator.

119668.9k2](/packages/gladcodes-keygen)[memio/spec-gen

phpspec extension for better code generation

66204.3k28](/packages/memio-spec-gen)

PHPackages © 2026

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