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

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

blocktrail/simply-random
========================

A simple library for generating secure randomness (strings, integers, shuffling)

v2.0.0(9y ago)77.8k3MITPHPPHP &gt;=5.6.0

Since Dec 15Pushed 9y ago1 watchersCompare

[ Source](https://github.com/blocktrail/simply-random-php)[ Packagist](https://packagist.org/packages/blocktrail/simply-random)[ Docs](https://github.com/blocktrail/simply-random)[ RSS](/packages/blocktrail-simply-random/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (3)Versions (3)Used By (0)

Simply Random
=============

[](#simply-random)

[![Latest Stable Version](https://camo.githubusercontent.com/7c3b483fa04fe66b5361e0f7a6443afb62ed303885e39c2f169119583a946e00/68747470733a2f2f62616467652e667572792e696f2f70682f626c6f636b747261696c25324673696d706c792d72616e646f6d2e737667)](https://packagist.org/packages/blocktrail/simply-random)[![Build Status](https://camo.githubusercontent.com/fcd246ba1094005a2c163259d7b9ab66bd87d68fe46491d3f950055812c1406f/68747470733a2f2f7472617669732d63692e6f72672f626c6f636b747261696c2f73696d706c792d72616e646f6d2d7068702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/blocktrail/simply-random-php)

tested on **5.6**, **7.0**, **7.1** and **HHVM**

What is this library?
---------------------

[](#what-is-this-library)

This is a simple library for random number generation using random\_bytes.
This library can generate strong, cryptographically secure random numbers, and other useful random values.

Dependencies
------------

[](#dependencies)

This library depends on `random_bytes` or the polyfill provided by ParagonIE. If provided as a native extension the kernel CSPRNG is used. The polyfill handles checking for appropriate sources of entropy if this is not available.

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

[](#installation)

Simply use `composer require blocktrail/simply-random ~1.0`.

Usage
-----

[](#usage)

Please refer to `test.php` for example usage.

Credits to ircmaxell
--------------------

[](#credits-to-ircmaxell)

Most of the code used in this library was originally written by [ircmaxell](https://github.com/ircmaxell)for [random\_compat](https://github.com/ircmaxell/random_compat). This library initially began as a fork with reduced complexity, and strong dependency on mcrypt.

see:

and more:

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 66.7% 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 ~750 days

Total

2

Last Release

3466d ago

Major Versions

v1.0.0 → v2.0.02017-01-04

PHP version history (2 changes)v1.0.0PHP &gt;=5.3.0

v2.0.0PHP &gt;=5.6.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/763cdc5cc50414bacd4ff1080eede79432f7c3cc26a3d8aa9031b1537a8bd734?d=identicon)[thomaskerin](/maintainers/thomaskerin)

![](https://avatars.githubusercontent.com/u/7208343?v=4)[BlockTrail](/maintainers/blocktrail)[@blocktrail](https://github.com/blocktrail)

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

---

Top Contributors

[![rubensayshi](https://avatars.githubusercontent.com/u/649160?v=4)](https://github.com/rubensayshi "rubensayshi (14 commits)")[![ircmaxell](https://avatars.githubusercontent.com/u/660654?v=4)](https://github.com/ircmaxell "ircmaxell (4 commits)")[![afk11](https://avatars.githubusercontent.com/u/5617245?v=4)](https://github.com/afk11 "afk11 (3 commits)")

---

Tags

random

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

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

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

###  Alternatives

[paragonie/random_compat

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

8.2k686.9M431](/packages/paragonie-random-compat)[ircmaxell/random-lib

A Library For Generating Secure Random Numbers

84032.1M131](/packages/ircmaxell-random-lib)[oat-sa/tao-core

TAO core extension

66143.7k121](/packages/oat-sa-tao-core)[paragonie/random-lib

A Library For Generating Secure Random Numbers

743.6M27](/packages/paragonie-random-lib)[mistic100/randomcolor

Generate attractive random colors

2451.5M6](/packages/mistic100-randomcolor)[pragmarx/random

Create random chars, numbers, strings

744.6M5](/packages/pragmarx-random)

PHPackages © 2026

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