PHPackages                             shijunjun/uniqid - 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. shijunjun/uniqid

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

shijunjun/uniqid
================

生成唯一的ID(整形和62进制的字符串)

v1.0.1(6y ago)12051MITPHPPHP &gt;=7.0.0

Since Sep 21Pushed 6y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (3)Used By (1)

uniqid
======

[](#uniqid)

生成唯一的ID(整形和62进制的字符串)

#### 用法

[](#用法)

```
# 下载安装
composer require shijunjun/uniqid
或
git clone https://github.com/shijunjun/uniqid.git
```

```
/*
 * 生成整数的uniqid
 * ex: 6581098968539725824
 */
echo ($number = \shijunjun\uniqid\Id::getUniqId()) . PHP_EOL;

/*
 * 生成62进制的uniqid
 * ex: 7Q9vbTWnK01
 */
echo ($str_uid = \shijunjun\uniqid\Id::getUniqIdTo62()) . PHP_EOL;

/*
 * 解析62进制字符串的uniqid
 * ex: 7Q9vbTWnK01 => 6581098968539725825
 */
echo \shijunjun\uniqid\Id::parseUniqIdForm62ToNumber($str_uid) . PHP_EOL;

/*
 * 解析整数uniqid
 * ex :
 * array (
 *  'date' => '2019-09-21 16:57:45', // 生成时间
 *  'sequence' => 0,                 // 毫秒内自增ID
 *  'time' => 1569056265.006,        // 生成时间戳
 *  'nodeid' => 0,                   // 机器节点ID
 * )
 */
var_export(\shijunjun\uniqid\Id::parseUniqId($number));

/*
 * 将62进制的uniqid转化位整数的uniqid
 * ex:
 * array (
 *  'date' => '2019-09-21 16:57:45', // 生成时间
 *  'sequence' => 1,                 // 毫秒内自增ID
 *  'time' => 1569056265.006,        // 生成时间戳
 *  'nodeid' => 0,                   // 机器节点ID
 * )
 */
var_export(\shijunjun\uniqid\Id::parseUniqIdForm62($str_uid));
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity54

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

Every ~22 days

Total

2

Last Release

2409d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/28e2e837a983a766e0eb9293408948e8caa9bc07d9883e3e39c4585a4fd89362?d=identicon)[shijunjun](/maintainers/shijunjun)

---

Top Contributors

[![shijunjun](https://avatars.githubusercontent.com/u/7324365?v=4)](https://github.com/shijunjun "shijunjun (7 commits)")

### Embed Badge

![Health badge](/badges/shijunjun-uniqid/health.svg)

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

###  Alternatives

[goszowski/laravel-vendor-minify

A vendor minify package, to remove tests and documentation and minifing all php files to save space

803.6k](/packages/goszowski-laravel-vendor-minify)

PHPackages © 2026

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