PHPackages                             jsnlib/rand - 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. jsnlib/rand

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

jsnlib/rand
===========

1.1.1(8y ago)0481MITPHPPHP &gt;=7.0.0

Since Mar 9Pushed 8y agoCompare

[ Source](https://github.com/fdjkgh580/jsnlib-rand)[ Packagist](https://packagist.org/packages/jsnlib/rand)[ RSS](/packages/jsnlib-rand/feed)WikiDiscussions master Synced 6d ago

READMEChangelogDependenciesVersions (6)Used By (1)

jsnlib-rand
===========

[](#jsnlib-rand)

取得多種形式的亂數

初始化

```
require_once 'vendor/autoload.php';
$rand = new Jsnlib\Rand;
```

取得一筆亂數

```
$rand->get(5, [1, 2, 3])[0];
// => 1x3DX
```

取得多筆單數

```
// 取得10筆亂數
$result = $rand->get(10, [1, 2, 3], 10);
foreach ($result as $val)
{
    echo $val."";
}
// =>
// SL47CUGOPq
// Y1pTRHLXIj
// nkKhGd9f57
// lfX7s1qwYs
// Z788ZARX9g
// 9YcCLzh0lU
// 1k10G9Z5b1
// wef8i9JLf3
// 3x969P4ie8
// o5K00e0c4I
```

### get\_np(int $length, array $type, int $quality = 1): array

[](#get_npint-length-array-type-int-quality--1-array)

取多個不重複字串

- length：要顯示的文字長度
- quality: 數量
- $type：1是數字，2是英文大寫，3是英文小寫。使用字串指定，例如 "1,3" 即亂數僅可出現數字與英文小寫

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity62

Established project with proven stability

 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 ~5 days

Total

5

Last Release

2971d ago

PHP version history (2 changes)1.0.0PHP &gt;=5.2.4

1.1.0PHP &gt;=7.0.0

### Community

Maintainers

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

---

Top Contributors

[![fdjkgh580-2](https://avatars.githubusercontent.com/u/60056647?v=4)](https://github.com/fdjkgh580-2 "fdjkgh580-2 (10 commits)")

---

Tags

arrayobjectrand

### Embed Badge

![Health badge](/badges/jsnlib-rand/health.svg)

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

###  Alternatives

[symfony/property-access

Provides functions to read and write from/to an object or array using a simple string notation

2.8k295.3M2.5k](/packages/symfony-property-access)[cuyz/valinor

Dependency free PHP library that helps to map any input into a strongly-typed structure.

1.5k9.2M108](/packages/cuyz-valinor)[jasny/dotkey

Dot notation access for objects and arrays

14219.5k6](/packages/jasny-dotkey)[michaldudek/foundation

A set of useful PHP classes.

13111.9k13](/packages/michaldudek-foundation)[peridot-php/object-path

A string syntax to fetch values from array and object hierarchies

1053.6k1](/packages/peridot-php-object-path)

PHPackages © 2026

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