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

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

arokettu/random-polyfill
========================

Random Extension Polyfill for PHP

1.99.0(3y ago)9741.8k↓11.1%3BSD-3-ClausePHPPHP &gt;= 8.2

Since Jul 23Pushed 8mo ago1 watchersCompare

[ Source](https://github.com/arokettu/php-random-polyfill)[ Packagist](https://packagist.org/packages/arokettu/random-polyfill)[ Docs](https://sandfox.dev/php/random-polyfill.html)[ RSS](/packages/arokettu-random-polyfill/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)DependenciesVersions (20)Used By (3)

Random Extension Polyfill for PHP
=================================

[](#random-extension-polyfill-for-php)

[![PHP](https://camo.githubusercontent.com/428f3bf6d3007dfb25b2910b618cb1f4be200741b2f46cd95e9943c0c4ab4d43/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f61726f6b657474752f72616e646f6d2d706f6c7966696c6c2f6465762d6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/arokettu/random-polyfill)[![License](https://camo.githubusercontent.com/3b34f67790f40d1f684b94bd84e552f629163d21e1700a7f90b2ad6b02a06a57/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f61726f6b657474752f72616e646f6d2d706f6c7966696c6c2e7376673f7374796c653d666c61742d737175617265)](COPYING.adoc)[![Gitlab pipeline status](https://camo.githubusercontent.com/00ef142747ee8777afd52f8801582cb9fea4033c22c6ca539ff637a71466a32e/68747470733a2f2f696d672e736869656c64732e696f2f6769746c61622f706970656c696e652f73616e64666f782f7068702d72616e646f6d2d706f6c7966696c6c2f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://gitlab.com/sandfox/php-random-polyfill/-/pipelines)[![Codecov](https://camo.githubusercontent.com/1f82c397e0d6ce25406b8fc48e9ab7e3a44b13c3479363887a192ecbd4607bbc/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f676c2f73616e64666f782f7068702d72616e646f6d2d706f6c7966696c6c3f7374796c653d666c61742d737175617265)](https://codecov.io/gl/sandfox/php-random-polyfill/)[![Packagist Downloads](https://camo.githubusercontent.com/1a953a0cbe2c26055424de9ffe3df5ee415a20ed44f9313f9db9b5b3236b5fd7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f61726f6b657474752f72616e646f6d2d706f6c7966696c6c3f7374796c653d666c61742d737175617265)](https://packagist.org/packages/arokettu/random-polyfill)

This is a polyfill for the new `ext-random` extension that was released with PHP 8.2.

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

[](#requirements)

- PHP 7.1
- GMP extension is strongly recommended on PHP 7

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

[](#installation)

```
composer require 'arokettu/random-polyfill'
```

Compatibility
-------------

[](#compatibility)

The library aims to be compatible with `ext-random` as released in PHP 8.2.0 and subsequent patch releases.

Documentation
-------------

[](#documentation)

### Random Extension

[](#random-extension)

Read the official PHP doc:

### The Polyfill

[](#the-polyfill)

Read full documentation here:

Also on Read the Docs:

Support
-------

[](#support)

Please file issues on our main repo at GitHub:

Feel free to ask any questions in our room on Gitter:

License
-------

[](#license)

The library is available as open source under the terms of the [3-Clause BSD License](LICENSE.md). See [COPYING.adoc](COPYING.adoc) for additional licenses.

###  Health Score

47

—

FairBetter than 94% of packages

Maintenance43

Moderate activity, may be stable

Popularity43

Moderate usage in the ecosystem

Community15

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 99.6% 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 ~71 days

Recently: every ~258 days

Total

17

Last Release

250d ago

Major Versions

0.5.0 → 1.99.02022-09-01

PHP version history (3 changes)0.1.0PHP ^7.1 | ^8.0

1.99.0PHP &gt;= 8.2

1.0.3PHP &gt;= 7.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/963485?v=4)[Anton Smirnov](/maintainers/arokettu)[@arokettu](https://github.com/arokettu)

---

Top Contributors

[![arokettu](https://avatars.githubusercontent.com/u/963485?v=4)](https://github.com/arokettu "arokettu (261 commits)")[![nicolas-grekas](https://avatars.githubusercontent.com/u/243674?v=4)](https://github.com/nicolas-grekas "nicolas-grekas (1 commits)")

---

Tags

phppolyfillrandompolyfillrandom

### Embed Badge

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

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

###  Alternatives

[paragonie/random_compat

PHP 5.x polyfill for random\_bytes() and random\_int() from PHP 7

8.2k655.0M405](/packages/paragonie-random-compat)[symfony/polyfill-mbstring

Symfony polyfill for the Mbstring extension

7.8k1.2B515](/packages/symfony-polyfill-mbstring)[symfony/polyfill-ctype

Symfony polyfill for ctype functions

4.0k982.0M125](/packages/symfony-polyfill-ctype)[symfony/polyfill-php72

Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions

4.7k674.7M31](/packages/symfony-polyfill-php72)[symfony/polyfill-intl-idn

Symfony polyfill for intl's idn\_to\_ascii and idn\_to\_utf8 functions

3.4k774.6M90](/packages/symfony-polyfill-intl-idn)[symfony/polyfill-intl-normalizer

Symfony polyfill for intl's Normalizer class and related functions

2.1k830.2M36](/packages/symfony-polyfill-intl-normalizer)

PHPackages © 2026

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