PHPackages                             alirezasalehizadeh/random - 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. alirezasalehizadeh/random

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

alirezasalehizadeh/random
=========================

The PHP Random tool.

v1.1.0(2y ago)013MITPHPPHP ^8.3

Since May 30Pushed 2y ago1 watchersCompare

[ Source](https://github.com/alirezasalehizadeh/Random)[ Packagist](https://packagist.org/packages/alirezasalehizadeh/random)[ RSS](/packages/alirezasalehizadeh-random/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

Random
======

[](#random)

An PHP tool for generate random values easily.

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

[](#requirements)

PHP &gt;= 8.3

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

[](#installation)

via Composer:

```
composer require alirezasalehizadeh/random

```

Usage
-----

[](#usage)

#### Integer

[](#integer)

###### Generate an random int

[](#generate-an-random-int)

```
use Alirezasalehizadeh\Random;

Random::int($min = null, $max = null)
```

#### Float

[](#float)

###### Generate an random float

[](#generate-an-random-float)

```
use Random\IntervalBoundary;
use Alirezasalehizadeh\Random;

Random::float($min = null, $max = null, $boundary = IntervalBoundary::ClosedOpen)
```

#### Byte

[](#byte)

###### Generate an random bytes with specific length

[](#generate-an-random-bytes-with-specific-length)

```
use Alirezasalehizadeh\Random;

Random::byte($length)
```

#### String

[](#string)

###### Generate an random string from given string

[](#generate-an-random-string-from-given-string)

```
use Alirezasalehizadeh\Random;

Random::string($bytes, $length = null)
```

#### Array

[](#array)

###### Generate an random array from given array

[](#generate-an-random-array-from-given-array)

```
use Alirezasalehizadeh\Random;

Random::array($array)
```

###### Pick random elements from given array

[](#pick-random-elements-from-given-array)

```
use Alirezasalehizadeh\Random;

Random::pick($array, $num = 1)
```

### [Engines](https://www.php.net/manual/en/class.random-engine.php)

[](#engines)

#### [Mt19937(Mersenne Twister)](https://www.php.net/manual/en/class.random-engine-mt19937.php)

[](#mt19937mersenne-twister)

```
use Random\Engine\Mt19937;
use Alirezasalehizadeh\Random;

(new Random(new Mt19937))->generate()
```

#### [PcgOneseq128XslRr64](https://www.php.net/manual/en/class.random-engine-pcgoneseq128xslrr64.php)

[](#pcgoneseq128xslrr64)

```
use Alirezasalehizadeh\Random;
use Random\Engine\PcgOneseq128XslRr64;

(new Random(new PcgOneseq128XslRr64))->generate()
```

#### [Xoshiro256StarStar](https://www.php.net/manual/en/class.random-engine-xoshiro256starstar.php)

[](#xoshiro256starstar)

```
use Alirezasalehizadeh\Random;
use Random\Engine\Xoshiro256StarStar;

(new Random(new Xoshiro256StarStar))->generate()
```

Contributing
------------

[](#contributing)

Send pull request or open issue for contributing.

License
-------

[](#license)

[MIT](LICENSE).

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity60

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

Total

2

Last Release

741d ago

PHP version history (2 changes)v1.0.0PHP ^8.2

v1.1.0PHP ^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/2d2fea36dd7d7e08bb16f8800f37b9b56e69e0e5cc2749603c96efe6fb378cb1?d=identicon)[alirezasalehizadeh](/maintainers/alirezasalehizadeh)

---

Top Contributors

[![alirezasalehizadeh](https://avatars.githubusercontent.com/u/66994089?v=4)](https://github.com/alirezasalehizadeh "alirezasalehizadeh (8 commits)")

---

Tags

phprandom

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/alirezasalehizadeh-random/health.svg)

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

###  Alternatives

[richjenks/stats

Statistics library for non-statistical people

23149.0k1](/packages/richjenks-stats)[withcandour/aardvark-seo

Save time and get your Statamic site to rank better with the SEO addon for Statamic.

13128.3k](/packages/withcandour-aardvark-seo)[joelwmale/livewire-quill

Easily add QuillJS with image support to any Laravel Livewire component.

1314.0k](/packages/joelwmale-livewire-quill)

PHPackages © 2026

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